Version 2.17.0-92.0.dev

Merge commit 'a4da39f702a532b65764ad51a28f2eae43dcbc64' into 'dev'
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 99b39d4..0e3ef9d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -29,14 +29,14 @@
 
 #### Dart command line
 
-- **Breaking Change** [#46100](https://github.com/dart-lang/sdk/issues/46100):
+- **Breaking change** [#46100](https://github.com/dart-lang/sdk/issues/46100):
   The standalone `dart2js` tool has been
   marked deprecated as previously announced.
   Its replacement is the `dart compile js` command.
   Should you find any issues, or missing features, in the replacement
   command, kindly file [an issue](https://github.com/dart-lang/sdk/issues/new).
 
-- **Breaking Change** [#46100](https://github.com/dart-lang/sdk/issues/46100):
+- **Breaking change** [#46100](https://github.com/dart-lang/sdk/issues/46100):
   The standalone `dartdevc` tool has been marked deprecated as previously
   announced and will be deleted in a future Dart stable relase.  This tool
   was intended for use only by build systems like bazel, `build_web_compilers`
@@ -45,7 +45,7 @@
   Please share any concerns in the
   [breaking change tracking issue](https://github.com/dart-lang/sdk/issues/46100).
 
-- **Breaking Change** [#46100](https://github.com/dart-lang/sdk/issues/46100):
+- **Breaking change** [#46100](https://github.com/dart-lang/sdk/issues/46100):
   The standalone `dartdoc` tool has been removed as
   previously announced. Its replacement is the `dart doc` command.
 
@@ -68,22 +68,23 @@
 
 #### `dart:io`
 
-- **Breaking Change** [#45410](https://github.com/dart-lang/sdk/issues/45410),
-  **security advisory** [CVE-2022-0451](https://github.com/dart-lang/sdk/security/advisories/GHSA-c8mh-jj22-xg5h):
+- **Security advisory**
+  [CVE-2022-0451](https://github.com/dart-lang/sdk/security/advisories/GHSA-c8mh-jj22-xg5h),
+  **breaking change** [#45410](https://github.com/dart-lang/sdk/issues/45410):
   `HttpClient` no longer transmits some headers (i.e. `authorization`,
   `www-authenticate`, `cookie`, `cookie2`) when processing redirects to a
   different domain.
-- **Breaking Change** [#47653](https://github.com/dart-lang/sdk/issues/47653):
+- **Breaking change** [#47653](https://github.com/dart-lang/sdk/issues/47653):
   On Windows, `Directory.rename` will no longer delete a directory if
   `newPath` specifies one. Instead, a `FileSystemException` will be thrown.
-- **Breaking Change** [#47769](https://github.com/dart-lang/sdk/issues/47769):
+- **Breaking change** [#47769](https://github.com/dart-lang/sdk/issues/47769):
   The `Platform.packageRoot` API has been removed. It had been marked deprecated
   in 2018, as it doesn't work with any Dart 2.x release.
 - Add optional `sourcePort` parameter to `Socket.connect`, `Socket.startConnect`, `RawSocket.connect` and `RawSocket.startConnect`
 
 #### `dart:isolate`
 
-- **Breaking Change** [#47769](https://github.com/dart-lang/sdk/issues/47769):
+- **Breaking change** [#47769](https://github.com/dart-lang/sdk/issues/47769):
 The `Isolate.packageRoot` API has been removed. It had been marked deprecated
 in 2018, as it doesn't work with any Dart 2.x release.
 
@@ -91,7 +92,7 @@
 
 #### Dart command line
 
-- **Breaking Change** [#46100](https://github.com/dart-lang/sdk/issues/46100):
+- **Breaking change** [#46100](https://github.com/dart-lang/sdk/issues/46100):
   The standalone `dartanalyzer` tool has been
   marked deprecated as previously announced.
   Its replacement is the `dart analyze` command.
@@ -100,7 +101,7 @@
 
 [an issue]: https://github.com/dart-lang/sdk/issues/new
 
-- **Breaking Change** [#46100](https://github.com/dart-lang/sdk/issues/46100):
+- **Breaking change** [#46100](https://github.com/dart-lang/sdk/issues/46100):
   The standalone `dartdoc` tool has been
   marked deprecated as previously announced.
   Its replacement is the `dart doc` command.
@@ -109,14 +110,6 @@
 
 [an issue]: https://github.com/dart-lang/sdk/issues/new
 
-- **Breaking Change** [#46100](https://github.com/dart-lang/sdk/issues/46100):
-  The deprecated standalone `pub` tool has been removed.
-  Its replacement is the `dart pub` command.
-  Should you find any issues, or missing features, in the replacement
-  command, kindly file [an issue][].
-
-[an issue]: https://github.com/dart-lang/pub/issues/new
-
 #### Pub
 
 - Fixed race conditions in `dart pub get`, `dart run` and `dart pub global run`.
@@ -168,6 +161,22 @@
 
 ## 2.15.0 - 2021-12-08
 
+- **Security advisory**
+  [CVE-2021-22567](https://github.com/dart-lang/sdk/security/advisories/GHSA-8pcp-6qc9-rqmv):
+  Bidirectional Unicode text can be interpreted and compiled differently than
+  how it appears in editors and code-review tools. Exploiting this an attacker
+  could embed source that is invisible to a code reviewer but that modifies the
+  behavior of a program in unexpected ways. Dart 2.15.0 introduces new analysis
+  warnings that flags the use of these.
+
+- **Security advisory**
+  [CVE-2021-22568](https://github.com/dart-lang/sdk/security/advisories/GHSA-r32f-vhjp-qhj7):
+  A malicious third-party package repository may impersonate a user on pub.dev
+  for up to one hour after the user has published a package to that third-party
+  package repository using `dart pub publish`. As of Dart SDK version 2.15.0
+  requests to third-party package repositories will no longer include an OAuth2
+  `access_token` intended for pub.dev.
+
 ### Language
 
 The following features are new in the Dart 2.15 [language version][]. To use
@@ -479,7 +488,7 @@
 
 #### `dart:io`
 
-- **Breaking Change** [#46875](https://github.com/dart-lang/sdk/issues/46875):
+- **Breaking change** [#46875](https://github.com/dart-lang/sdk/issues/46875):
   The `SecurityContext` class in `dart:io` has been updated to set the minimum
   TLS protocol version to TLS1_2_VERSION (1.2) instead of TLS1_VERSION.
 - Add `RawSocket.sendMessage`, `RawSocket.receiveMessage` that allow passing of
@@ -496,14 +505,14 @@
 
 #### `dart:web_sql`
 
-- **Breaking Change** [#46316](https://github.com/dart-lang/sdk/issues/46316):
+- **Breaking change** [#46316](https://github.com/dart-lang/sdk/issues/46316):
   The WebSQL standard was abandoned more than 10
   years ago and is not supported by many browsers. This release completely
   deletes the `dart:web_sql` library.
 
 #### `dart:html`
 
-- **Breaking Change** [#46316](https://github.com/dart-lang/sdk/issues/46316):
+- **Breaking change** [#46316](https://github.com/dart-lang/sdk/issues/46316):
   Related to the removal of `dart:web_sql` (see above), `window.openDatabase`
   has been removed.
 
@@ -511,12 +520,12 @@
 
 #### Dart command line
 
-- **Breaking Change** [#46100][]: The standalone `dart2native` tool has been
+- **Breaking change** [#46100][]: The standalone `dart2native` tool has been
   removed as previously announced. Its replacements are the
   `dart compile exe` and `dart compile aot-snapshot` commands, which offer the
   same functionality.
 
-- **Breaking Change**: The standalone `dartfmt` tool has been removed as
+- **Breaking change**: The standalone `dartfmt` tool has been removed as
   previously announced. Its replacement is the `dart format` command.
 
   Note that `dart format` has [a different set of options and
@@ -527,11 +536,11 @@
 
 #### Dart VM
 
-- **Breaking Change** [#45451](https://github.com/dart-lang/sdk/issues/45451):
+- **Breaking change** [#45451](https://github.com/dart-lang/sdk/issues/45451):
   Support for `dart-ext:`-style native extensions has been removed as previously
   announced. Use `dart:ffi` to bind to native libraries instead.
 
-- **Breaking Change** [#46754](https://github.com/dart-lang/sdk/issues/46754):
+- **Breaking change** [#46754](https://github.com/dart-lang/sdk/issues/46754):
   Isolates spawned via the `Isolate.spawn()` API are now grouped, operate on the
   same managed heap and can therefore share various VM-internal data structures.
 
@@ -820,7 +829,7 @@
 
 ### Dart VM
 
-- **Breaking Change** [#45071][]: `Dart_NewWeakPersistentHandle`'s and
+- **Breaking change** [#45071][]: `Dart_NewWeakPersistentHandle`'s and
   `Dart_NewFinalizableHandle`'s `object` parameter no longer accepts `Pointer`s
   and subtypes of `Struct`. Expandos no longer accept `Pointer`s and subtypes of
   `Struct`s.
@@ -831,13 +840,13 @@
 
 #### Dart command line
 
-- **Breaking Change** [#46100][]: The standalone `dart2native` tool has been
+- **Breaking change** [#46100][]: The standalone `dart2native` tool has been
   marked deprecated, and now prints a warning message. Its replacements are the
   `dart compile exe` and `dart compile aot-snapshot` commands, which offer the
   same functionality. The `dart2native` tool will be removed from the Dart SDK
   in Dart 2.15.
 
-- **Breaking Change**: The standalone `dartfmt` tool has been marked deprecated,
+- **Breaking change**: The standalone `dartfmt` tool has been marked deprecated,
   and now prints a warning message. Instead, use `dart format`. The `dartfmt`
   tool will be removed from the Dart SDK in Dart 2.15.
 
@@ -961,7 +970,7 @@
 
 #### Dart2JS
 
-*   **Breaking Change** [#46545][]: Dart2JS emits ES6+ JavaScript by default,
+*   **Breaking change** [#46545][]: Dart2JS emits ES6+ JavaScript by default,
     thereby no longer supporting legacy browsers. Passing the
     `--legacy-javascript` flag will let you opt out of this update, but this
     flag will be removed in a future release. Modern browsers will not be
@@ -973,7 +982,7 @@
 
 #### Dart Dev Compiler (DDC)
 
-- **Breaking Change** [#44154][]: Subtyping relations of `package:js` classes
+- **Breaking change** [#44154][]: Subtyping relations of `package:js` classes
   have been changed to be more correct and consistent with Dart2JS.
   Like `anonymous` classes, non-`anonymous` classes will no longer check the
   underlying type in DDC. The internal type representation of these objects have
@@ -1142,10 +1151,10 @@
 
 ## 2.12.3 - 2021-04-14
 
-This is a patch release that fixes a vulnerability in `dart:html` related to DOM
-clobbering. See the [vulnerability advisory][cve-2021-22540] for more details.
-Thanks again to **Vincenzo di Cicco** for finding and reporting this
-vulnerability.
+**Security advisory**: This is a patch release that fixes a vulnerability in
+`dart:html` related to DOM clobbering. See the security advisory
+[CVE-2021-22540][cve-2021-22540] for more details. Thanks again to **Vincenzo di
+Cicco** for finding and reporting this vulnerability.
 
 [cve-2021-22540]:
   https://github.com/dart-lang/sdk/security/advisories/GHSA-3rfv-4jvg-9522
@@ -1171,7 +1180,7 @@
 
 ### Language
 
-- **Breaking Change** [Null safety][] is now enabled by default in all code that
+- **Breaking change** [Null safety][] is now enabled by default in all code that
   has not opted out. With null safety, types in your code are non-nullable by
   default. Null can only flow into parts of your program where you want it. With
   null safety, your runtime null-dereference bugs turn into edit-time analysis
@@ -1191,7 +1200,7 @@
   - The postfix `!` null assertion operator
   - The `?..` and `?[]` null-aware operators
 
-- **Breaking Change** [#44660][]: Fixed an implementation bug where `this` would
+- **Breaking change** [#44660][]: Fixed an implementation bug where `this` would
   sometimes undergo type promotion in extensions.
 
 [null safety]: https://dart.dev/null-safety/understanding-null-safety
@@ -1243,12 +1252,12 @@
 
 ### Dart VM
 
-- **Breaking Change** [#42312][]: `Dart_WeakPersistentHandle`s no longer
+- **Breaking change** [#42312][]: `Dart_WeakPersistentHandle`s no longer
   auto-delete themselves when the referenced object is garbage collected to
   avoid race conditions, but they are still automatically deleted when the
   isolate group shuts down.
 
-- **Breaking Change** [#42312][]: `Dart_WeakPersistentHandleFinalizer` is
+- **Breaking change** [#42312][]: `Dart_WeakPersistentHandleFinalizer` is
   renamed to `Dart_HandleFinalizer` and had its `handle` argument removed. All
   API functions using that type have been updated.
 
@@ -1256,7 +1265,7 @@
 
 ### Foreign Function Interface (`dart:ffi`)
 
-- **Breaking Change** [#44621][]: Invocations with a generic `T` of `sizeOf<T>`,
+- **Breaking change** [#44621][]: Invocations with a generic `T` of `sizeOf<T>`,
   `Pointer<T>.elementAt()`, `Pointer<T extends Struct>.ref`, and
   `Pointer<T extends Struct>[]` are being deprecated in the current stable
   release (2.12), and are planned to be fully removed in the following stable
@@ -1266,7 +1275,7 @@
   constant `T` on invocations. For migration notes see the breaking change
   request.
 
-- **Breaking Change** [#44622][]: Subtypes of `Struct` without any native member
+- **Breaking change** [#44622][]: Subtypes of `Struct` without any native member
   are being deprecated in the current stable release (2.12), and are planned to
   be fully removed in the following stable release (2.13). Migrate opaque types
   to extend `Opaque` rather than `Struct`.
@@ -1548,7 +1557,7 @@
 
 ### Dart VM
 
-- **Breaking Change** [#42982][]: `dart_api_dl.cc` is renamed to `dart_api_dl.c`
+- **Breaking change** [#42982][]: `dart_api_dl.cc` is renamed to `dart_api_dl.c`
   and changed to a pure C file.
 - Introduces `Dart_FinalizableHandle`s. They do auto-delete, and the weakly
   referred object cannot be accessed through them.
@@ -1637,7 +1646,7 @@
 
 #### `dart:convert`
 
-- **Breaking Change** [#41100][]: When encoding a string containing unpaired
+- **Breaking change** [#41100][]: When encoding a string containing unpaired
   surrogates as UTF-8, the unpaired surrogates will be encoded as replacement
   characters (`U+FFFD`). When decoding UTF-8, encoded surrogates will be treated
   as malformed input. When decoding UTF-8 with `allowMalformed: true`, the
@@ -1669,7 +1678,7 @@
 
 #### `dart:html`
 
-- **Breaking Change**: `CssClassSet.add()` previously returned `null` if the
+- **Breaking change**: `CssClassSet.add()` previously returned `null` if the
   `CssClassSet` corresponded to multiple elements. In order to align with the
   null-safe changes in the `Set` interface, it will now return `false` instead.
   The same applies for `CssClassSet.toggle`.
@@ -1690,7 +1699,7 @@
 
 #### `dart:mirrors`
 
-- **Breaking Change** [#42714][]: web compilers (dart2js and DDC) now produce a
+- **Breaking change** [#42714][]: web compilers (dart2js and DDC) now produce a
   compile-time error if `dart:mirrors` is imported.
 
   Most projects should not be affected. Since 2.0.0 this library was unsupported
@@ -1741,7 +1750,7 @@
 
 ### Dart VM
 
-- **Breaking Change** [#41100][]: When printing a string using the `print`
+- **Breaking change** [#41100][]: When printing a string using the `print`
   function, the default implementation (used when not overridden by the embedder
   or the current zone) will print any unpaired surrogates in the string as
   replacement characters (`U+FFFD`). Similarly, the `Dart_StringToUTF8` function
@@ -1899,12 +1908,12 @@
 
 #### `dart:html`
 
-- **Breaking Change** [#39627][]: Changed the return type of several HTML native
+- **Breaking change** [#39627][]: Changed the return type of several HTML native
   methods involving futures. In return types that matched `Future<List<T>>`,
   `T was` changed to `dynamic`. These methods would have resulted in a runtime
   error if they were used.
 
-- **Breaking Change**: `Node.insertAllBefore()` erroneously had a return type of
+- **Breaking change**: `Node.insertAllBefore()` erroneously had a return type of
   `Node`, even though it was not returning anything. This has been corrected to
   `void`.
 
@@ -2038,7 +2047,7 @@
 
 ### Foreign Function Interface (`dart:ffi`)
 
-- **Breaking Change**: Changed `Pointer.asFunction()` and
+- **Breaking change**: Changed `Pointer.asFunction()` and
   `DynamicLibrary.lookupFunction()` to extension methods. Invoking them
   dynamically previously already threw an exception, so the runtime behavior
   stays the same. However, the extension methods are only visible if `dart:ffi`
@@ -2057,7 +2066,7 @@
 frequently encounter code that is accepted by one compiler but then fails in the
 other.
 
-- **Breaking Change**: Deleted the legacy (analyzer based) version of DDC. For
+- **Breaking change**: Deleted the legacy (analyzer based) version of DDC. For
   additional details see the [announcement][ddc].
 
   - The `--kernel` option is now ignored and defaults to true. There is no
@@ -2070,12 +2079,12 @@
     deleted from `dart-sdk/lib/dev_compiler` in favor of the versions located at
     `dart-sdk/lib/dev_compiler/kernel`.
 
-- **Breaking Change**: Functions passed to JavaScript using the recommended
+- **Breaking change**: Functions passed to JavaScript using the recommended
   `package:js` interop specification must now be wrapped with a call to
   `allowInterop`. This behavior was always enforced by Dart2JS, but was not
   enforced consistently by DDC. It is now enforced by both.
 
-- **Breaking Change**: Constructors in `@JS()` classes must be marked with
+- **Breaking change**: Constructors in `@JS()` classes must be marked with
   `external`. Previously the `external` could be omitted in some cases with DDC
   but doing so would cause incorrect behavior with Dart2JS.
 
@@ -2146,16 +2155,16 @@
 - JS interop classes with an index operator are now static errors instead of
   causing invalid code in Dart2JS.
 
-- **Breaking Change**: The subtyping rule for generic functions is now more
+- **Breaking change**: The subtyping rule for generic functions is now more
   forgiving. Corresponding type parameter bounds now only need to be mutual
   subtypes rather than structurally equal up to renaming of bound type variables
   and equating all top types.
 
-- **Breaking Change**: Types are now normalized. See [normalization][] for the
+- **Breaking change**: Types are now normalized. See [normalization][] for the
   full specification. Types will now be printed in their normal form, and mutual
   subtypes with the same normal form will now be considered equal.
 
-- **Breaking Change**: Constructors in `@JS()` classes must be marked with
+- **Breaking change**: Constructors in `@JS()` classes must be marked with
   `external`. Previously, the external could be omitted for unused constructors.
   Omitting `external` for a constructor which is used would cause incorrect
   behavior at runtime, now omitting it on any constructor is a static error.
@@ -2166,7 +2175,7 @@
 
 Other dart2js changes:
 
-- **Breaking Change**: The `--package-root` flag, which was hidden and disabled
+- **Breaking change**: The `--package-root` flag, which was hidden and disabled
   in Dart 2.0.0, has been completely removed. Passing this flag will now cause
   `dart2js` to fail.
 
@@ -2230,10 +2239,10 @@
 
 ## 2.7.2 - 2020-03-23
 
-This is a patch release that addresses a vulnerability in `dart:html`
-[NodeValidator][] related to DOM clobbering of `previousSibling`. See the
-[vulnerability advisory][cve-2020-8923] for more details. Thanks to **Vincenzo
-di Cicco** for finding and reporting this issue.
+**Security advisory**: This is a patch release that addresses a vulnerability in
+`dart:html` [NodeValidator][] related to DOM clobbering of `previousSibling`.
+See the security advisory [CVE-2020-8923][cve-2020-8923] for more details.
+Thanks to **Vincenzo di Cicco** for finding and reporting this issue.
 
 This release also improves compatibility with ARMv8 processors (issue [40001][])
 and dart:io stability (issue [40589][]).
@@ -2250,7 +2259,7 @@
 
 [40217]: https://github.com/dart-lang/sdk/issues/40217
 
-**Breaking Change**: The Dart SDK for macOS is now only available for x64 (issue
+**Breaking change**: The Dart SDK for macOS is now only available for x64 (issue
 [39810][]).
 
 [39810]: https://github.com/dart-lang/sdk/issues/39810
@@ -2265,7 +2274,7 @@
 
 ### Language
 
-- **Breaking Change**: [Static extension members][] are accessible when imported
+- **Breaking change**: [Static extension members][] are accessible when imported
   with a prefix (issue [671][]). In the extension method **preview** launch,
   importing a library with a prefix hid all extension members in addition to
   hiding the extension name, thereby making them inaccessible in the importing
@@ -3246,7 +3255,7 @@
 
 #### `dart:io`
 
-- **Breaking Change:** Adding to a closed `IOSink` now throws a `StateError`.
+- **Breaking change:** Adding to a closed `IOSink` now throws a `StateError`.
 - Added ability to get and set low level socket options.
 
 [29554]: https://github.com/dart-lang/sdk/issues/29554
diff --git a/DEPS b/DEPS
index e65568d..a6780e6 100644
--- a/DEPS
+++ b/DEPS
@@ -44,7 +44,7 @@
   # 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
   # has.
-  "co19_rev": "1247f4096b835f31465e8f71dece427e95b51534",
+  "co19_rev": "0d38c8081e4da585262ed08ddde3dd85dc779dba",
   # This line prevents conflicts when both packages are rolled simultaneously.
   "co19_2_rev": "995745937abffe9fc3a6441f9f0db27b2d706e4c",
 
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/sort_unnamed_constructor_first.dart b/pkg/analysis_server/lib/src/services/correction/dart/sort_unnamed_constructor_first.dart
new file mode 100644
index 0000000..bfbcb2a
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/correction/dart/sort_unnamed_constructor_first.dart
@@ -0,0 +1,60 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/correction/dart/abstract_producer.dart';
+import 'package:analysis_server/src/services/correction/fix.dart';
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer_plugin/utilities/change_builder/change_builder_core.dart';
+import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
+import 'package:analyzer_plugin/utilities/range_factory.dart';
+import 'package:collection/collection.dart';
+
+class SortUnnamedConstructorFirst extends CorrectionProducer {
+  @override
+  bool get canBeAppliedInBulk => true;
+
+  @override
+  bool get canBeAppliedToFile => true;
+
+  @override
+  FixKind get fixKind => DartFixKind.SORT_UNNAMED_CONSTRUCTOR_FIRST;
+
+  @override
+  FixKind get multiFixKind => DartFixKind.SORT_UNNAMED_CONSTRUCTOR_FIRST_MULTI;
+
+  @override
+  Future<void> compute(ChangeBuilder builder) async {
+    var clazz = coveredNode?.parent?.parent;
+    if (clazz is! ClassDeclaration) return;
+
+    final firstConstructor = clazz.childEntities
+            .firstWhereOrNull((child) => child is ConstructorDeclaration)
+        as ConstructorDeclaration?;
+    if (firstConstructor == null ||
+        firstConstructor.name == null ||
+        firstConstructor.name?.name == 'new') return;
+
+    final unnamedConstructor = clazz.childEntities.firstWhereOrNull(
+            (child) => child is ConstructorDeclaration && child.name == null)
+        as ConstructorDeclaration?;
+    if (unnamedConstructor == null) return;
+
+    await builder.addDartFileEdit(file, (builder) {
+      var deletionRange = range.endEnd(
+        unnamedConstructor.beginToken.previous!,
+        unnamedConstructor.endToken,
+      );
+
+      builder.addDeletion(deletionRange);
+      builder.addSimpleInsertion(
+        firstConstructor.beginToken.previous!.end,
+        utils.getRangeText(deletionRange),
+      );
+    });
+  }
+
+  /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
+  static SortUnnamedConstructorFirst newInstance() =>
+      SortUnnamedConstructorFirst();
+}
diff --git a/pkg/analysis_server/lib/src/services/correction/fix.dart b/pkg/analysis_server/lib/src/services/correction/fix.dart
index 5a003bb..8a91925 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix.dart
@@ -1440,6 +1440,16 @@
     DartFixKindPriority.IN_FILE,
     'Move child properties to ends of arguments everywhere in file',
   );
+  static const SORT_UNNAMED_CONSTRUCTOR_FIRST = FixKind(
+    'dart.fix.sort.sortUnnamedConstructorFirst',
+    DartFixKindPriority.DEFAULT,
+    'Move before named constructors',
+  );
+  static const SORT_UNNAMED_CONSTRUCTOR_FIRST_MULTI = FixKind(
+    'dart.fix.sort.sortUnnamedConstructorFirst.multi',
+    DartFixKindPriority.DEFAULT,
+    'Move all unnamed constructors before named constructors',
+  );
   static const UPDATE_SDK_CONSTRAINTS = FixKind(
     'dart.fix.updateSdkConstraints',
     DartFixKindPriority.DEFAULT,
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index b007623..a09d76c 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -170,6 +170,7 @@
 import 'package:analysis_server/src/services/correction/dart/replace_with_tear_off.dart';
 import 'package:analysis_server/src/services/correction/dart/replace_with_var.dart';
 import 'package:analysis_server/src/services/correction/dart/sort_child_property_last.dart';
+import 'package:analysis_server/src/services/correction/dart/sort_unnamed_constructor_first.dart';
 import 'package:analysis_server/src/services/correction/dart/update_sdk_constraints.dart';
 import 'package:analysis_server/src/services/correction/dart/use_const.dart';
 import 'package:analysis_server/src/services/correction/dart/use_curly_braces.dart';
@@ -571,6 +572,9 @@
     LintNames.sort_child_properties_last: [
       SortChildPropertyLast.newInstance,
     ],
+    LintNames.sort_unnamed_constructors_first: [
+      SortUnnamedConstructorFirst.newInstance,
+    ],
     LintNames.type_annotate_public_apis: [
       AddTypeAnnotation.newInstanceBulkFixable,
     ],
diff --git a/pkg/analysis_server/lib/src/services/linter/lint_names.dart b/pkg/analysis_server/lib/src/services/linter/lint_names.dart
index 1a6d4e2..62d8f5e 100644
--- a/pkg/analysis_server/lib/src/services/linter/lint_names.dart
+++ b/pkg/analysis_server/lib/src/services/linter/lint_names.dart
@@ -113,6 +113,8 @@
   static const String slash_for_doc_comments = 'slash_for_doc_comments';
   static const String sort_child_properties_last = 'sort_child_properties_last';
   static const String sort_constructors_first = 'sort_constructors_first';
+  static const String sort_unnamed_constructors_first =
+      'sort_unnamed_constructors_first';
   static const String type_annotate_public_apis = 'type_annotate_public_apis';
   static const String type_init_formals = 'type_init_formals';
   static const String unawaited_futures = 'unawaited_futures';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/sort_unnamed_constructor_first_test.dart b/pkg/analysis_server/test/src/services/correction/fix/sort_unnamed_constructor_first_test.dart
new file mode 100644
index 0000000..9eddd90b
--- /dev/null
+++ b/pkg/analysis_server/test/src/services/correction/fix/sort_unnamed_constructor_first_test.dart
@@ -0,0 +1,114 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/correction/fix.dart';
+import 'package:analysis_server/src/services/linter/lint_names.dart';
+import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'fix_processor.dart';
+
+void main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(SortUnnamedConstructorFirstBulkTest);
+    defineReflectiveTests(SortUnnamedConstructorFirstTest);
+  });
+}
+
+@reflectiveTest
+class SortUnnamedConstructorFirstBulkTest extends BulkFixProcessorTest {
+  @override
+  String get lintCode => LintNames.sort_unnamed_constructors_first;
+
+  Future<void> test_one_fix() async {
+    await resolveTestCode('''
+class A {
+  A.a();
+  A();
+}
+
+class B {
+  B.b();
+  B();
+}
+''');
+    await assertHasFix('''
+class A {
+  A();
+  A.a();
+}
+
+class B {
+  B();
+  B.b();
+}
+''');
+  }
+}
+
+@reflectiveTest
+class SortUnnamedConstructorFirstTest extends FixProcessorLintTest {
+  @override
+  FixKind get kind => DartFixKind.SORT_UNNAMED_CONSTRUCTOR_FIRST;
+
+  @override
+  String get lintCode => LintNames.sort_unnamed_constructors_first;
+
+  Future<void> test_one_fix() async {
+    await resolveTestCode('''
+class A {
+  A.a();
+  A();
+}
+''');
+    await assertHasFix('''
+class A {
+  A();
+  A.a();
+}
+''');
+  }
+
+  Future<void> test_with_non_constructors() async {
+    await resolveTestCode('''
+class A {
+  static const int i = 0;
+
+  A.a();
+
+  A();
+}
+''');
+    await assertHasFix('''
+class A {
+  static const int i = 0;
+
+  A();
+
+  A.a();
+}
+''');
+  }
+
+  Future<void> test_with_non_constructors_2() async {
+    await resolveTestCode('''
+class A {
+  A.a();
+
+  static const int i = 0;
+
+  A();
+}
+''');
+    await assertHasFix('''
+class A {
+
+  A();
+  A.a();
+
+  static const int i = 0;
+}
+''');
+  }
+}
diff --git a/pkg/analysis_server/test/src/services/correction/fix/test_all.dart b/pkg/analysis_server/test/src/services/correction/fix/test_all.dart
index 41969f1..4196118 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/test_all.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/test_all.dart
@@ -207,6 +207,8 @@
 import 'replace_with_tear_off_test.dart' as replace_with_tear_off;
 import 'replace_with_var_test.dart' as replace_with_var;
 import 'sort_child_property_last_test.dart' as sort_properties_last;
+import 'sort_unnamed_constructor_first_test.dart'
+    as sort_unnamed_constructor_first_test;
 import 'update_sdk_constraints_test.dart' as update_sdk_constraints;
 import 'use_const_test.dart' as use_const;
 import 'use_curly_braces_test.dart' as use_curly_braces;
@@ -398,6 +400,7 @@
     replace_with_tear_off.main();
     replace_with_var.main();
     sort_properties_last.main();
+    sort_unnamed_constructor_first_test.main();
     update_sdk_constraints.main();
     use_const.main();
     use_curly_braces.main();
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 4c636e3..f8d3873 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -73,7 +73,6 @@
   BackendStrategy backendStrategy;
   CompilerDiagnosticReporter _reporter;
   Map<Entity, WorldImpact> _impactCache;
-  ImpactCacheDeleter _impactCacheDeleter;
 
   ImpactStrategy impactStrategy = const ImpactStrategy();
 
@@ -98,7 +97,6 @@
 
   DiagnosticReporter get reporter => _reporter;
   Map<Entity, WorldImpact> get impactCache => _impactCache;
-  ImpactCacheDeleter get impactCacheDeleter => _impactCacheDeleter;
 
   final Environment environment;
 
@@ -170,7 +168,6 @@
         kernelFrontEndTask, options, reporter, environment);
     backendStrategy = createBackendStrategy();
     _impactCache = <Entity, WorldImpact>{};
-    _impactCacheDeleter = _MapImpactCacheDeleter(_impactCache);
 
     if (options.showInternalProgress) {
       progress = InteractiveProgress();
@@ -437,7 +434,7 @@
     // this until after the resolution queue is processed.
     deferredLoadTask.beforeResolution(rootLibraryUri, libraries);
 
-    impactStrategy = JavaScriptImpactStrategy(impactCacheDeleter, dumpInfoTask,
+    impactStrategy = JavaScriptImpactStrategy(dumpInfoTask,
         supportDeferredLoad: deferredLoadTask.isProgramSplit,
         supportDumpInfo: options.dumpInfo);
 
@@ -469,8 +466,7 @@
     _userCodeLocations
         .addAll(result.moduleLibraries.map((module) => CodeLocation(module)));
     selfTask.measureSubtask('runModularAnalysis', () {
-      impactStrategy = JavaScriptImpactStrategy(
-          impactCacheDeleter, dumpInfoTask,
+      impactStrategy = JavaScriptImpactStrategy(dumpInfoTask,
           supportDeferredLoad: true, supportDumpInfo: true);
       var included = result.moduleLibraries.toSet();
       var elementMap = (frontendStrategy as KernelFrontendStrategy).elementMap;
@@ -590,6 +586,11 @@
 
     KClosedWorld kClosedWorld = resolutionWorldBuilder.closeWorld(reporter);
     OutputUnitData result = deferredLoadTask.run(mainFunction, kClosedWorld);
+
+    // Impact data is no longer needed.
+    if (!retainDataForTesting) {
+      _impactCache.clear();
+    }
     JClosedWorld jClosedWorld =
         backendStrategy.createJClosedWorld(kClosedWorld, result);
     return jClosedWorld;
@@ -626,9 +627,6 @@
       emptyQueue(enqueuer, onProgress: onProgress);
       enqueuer.queueIsClosed = true;
       enqueuer.close();
-      // Notify the impact strategy impacts are no longer needed for this
-      // enqueuer.
-      impactStrategy.onImpactUsed(enqueuer.impactUse);
       assert(compilationFailed ||
           enqueuer.checkNoEnqueuedInvokedInstanceMethods(elementEnvironment));
     });
@@ -1066,23 +1064,6 @@
   }
 }
 
-class _MapImpactCacheDeleter implements ImpactCacheDeleter {
-  final Map<Entity, WorldImpact> _impactCache;
-  _MapImpactCacheDeleter(this._impactCache);
-
-  @override
-  void uncacheWorldImpact(Entity element) {
-    if (retainDataForTesting) return;
-    _impactCache.remove(element);
-  }
-
-  @override
-  void emptyCache() {
-    if (retainDataForTesting) return;
-    _impactCache.clear();
-  }
-}
-
 class _EmptyEnvironment implements Environment {
   const _EmptyEnvironment();
 
diff --git a/pkg/compiler/lib/src/deferred_load/deferred_load.dart b/pkg/compiler/lib/src/deferred_load/deferred_load.dart
index 503c1bb..6aeafcd 100644
--- a/pkg/compiler/lib/src/deferred_load/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load/deferred_load.dart
@@ -445,10 +445,6 @@
     }
 
     reporter.withCurrentElement(main.library, () => measure(work));
-
-    // Notify that we no longer need impacts for deferred load, so they can be
-    // discarded at this time.
-    compiler.impactStrategy.onImpactUsed(DeferredLoadTask.IMPACT_USE);
     return _buildResult();
   }
 
diff --git a/pkg/compiler/lib/src/dump_info.dart b/pkg/compiler/lib/src/dump_info.dart
index f7c4faf..38b59d0 100644
--- a/pkg/compiler/lib/src/dump_info.dart
+++ b/pkg/compiler/lib/src/dump_info.dart
@@ -666,9 +666,6 @@
       }
     }
 
-    // Notify the impact strategy impacts are no longer needed for dump info.
-    compiler.impactStrategy.onImpactUsed(IMPACT_USE);
-
     // Track dependencies that come from inlining.
     for (Entity entity in inlineMap.keys) {
       CodeInfo outerInfo = infoCollector._entityToInfo[entity];
diff --git a/pkg/compiler/lib/src/frontend_strategy.dart b/pkg/compiler/lib/src/frontend_strategy.dart
index 1edd506..3fc6ccc 100644
--- a/pkg/compiler/lib/src/frontend_strategy.dart
+++ b/pkg/compiler/lib/src/frontend_strategy.dart
@@ -64,16 +64,3 @@
 
   void extractJsInteropAnnotations(LibraryEntity library);
 }
-
-/// Class that deletes the contents of an [WorldImpact] cache.
-// TODO(redemption): this can be deleted when we sunset the old front end.
-abstract class ImpactCacheDeleter {
-  /// Removes the [WorldImpact] for [element] from the resolution cache. Later
-  /// calls to [getWorldImpact] or [computeWorldImpact] returns an empty impact.
-  void uncacheWorldImpact(Entity element);
-
-  /// Removes the [WorldImpact]s for all [Element]s in the resolution cache. ,
-  /// Later calls to [getWorldImpact] or [computeWorldImpact] returns an empty
-  /// impact.
-  void emptyCache();
-}
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 164d917..f9e007c 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -10,7 +10,6 @@
 import '../dump_info.dart' show DumpInfoTask;
 import '../elements/entities.dart';
 import '../enqueue.dart' show ResolutionEnqueuer;
-import '../frontend_strategy.dart';
 import '../inferrer/types.dart';
 import '../js_model/elements.dart';
 import '../tracer.dart';
@@ -263,12 +262,11 @@
 }
 
 class JavaScriptImpactStrategy extends ImpactStrategy {
-  final ImpactCacheDeleter impactCacheDeleter;
   final DumpInfoTask dumpInfoTask;
   final bool supportDeferredLoad;
   final bool supportDumpInfo;
 
-  JavaScriptImpactStrategy(this.impactCacheDeleter, this.dumpInfoTask,
+  JavaScriptImpactStrategy(this.dumpInfoTask,
       {this.supportDeferredLoad, this.supportDumpInfo});
 
   @override
@@ -291,13 +289,6 @@
       impact.apply(visitor);
     }
   }
-
-  @override
-  void onImpactUsed(ImpactUseCase impactUse) {
-    if (impactUse == DeferredLoadTask.IMPACT_USE) {
-      impactCacheDeleter.emptyCache();
-    }
-  }
 }
 
 /// Interface for resources only used during code generation.
diff --git a/pkg/compiler/lib/src/universe/world_impact.dart b/pkg/compiler/lib/src/universe/world_impact.dart
index 19fe89f..7368e456 100644
--- a/pkg/compiler/lib/src/universe/world_impact.dart
+++ b/pkg/compiler/lib/src/universe/world_impact.dart
@@ -323,12 +323,6 @@
     // Apply unconditionally.
     impact.apply(visitor);
   }
-
-  /// Notifies the strategy that no more impacts of [impactUseCase] will be
-  /// applied.
-  void onImpactUsed(ImpactUseCase impactUseCase) {
-    // Do nothing.
-  }
 }
 
 /// Visitor used to process the uses of a [WorldImpact].
diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn
index 8e6a103..867dd32 100644
--- a/sdk/BUILD.gn
+++ b/sdk/BUILD.gn
@@ -39,6 +39,7 @@
 # ......dartanalyzer
 # ......dartdevc
 # ......utils/gen_snapshot or utils/gen_snapshot.exe (if not on ia32)
+# ......pub
 # ......snapshots/
 # ........analysis_server.dart.snapshot
 # ........dart2js.dart.snapshot
@@ -87,12 +88,16 @@
 # ......api_readme.md
 
 # Scripts that go under bin/
-_platform_sdk_scripts = [ "dartanalyzer" ]
+_platform_sdk_scripts = [
+  "dartanalyzer",
+  "pub",
+]
 
 _full_sdk_scripts = [
   "dart2js",
   "dartanalyzer",
   "dartdevc",
+  "pub",
 ]
 
 # Snapshots that go under bin/snapshots
diff --git a/sdk/bin/pub.bat b/sdk/bin/pub.bat
new file mode 100644
index 0000000..7eb8b0d
--- /dev/null
+++ b/sdk/bin/pub.bat
@@ -0,0 +1,56 @@
+@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/bin/pub_sdk b/sdk/bin/pub_sdk
new file mode 100755
index 0000000..17ce14c
--- /dev/null
+++ b/sdk/bin/pub_sdk
@@ -0,0 +1,47 @@
+#!/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)"
+DART="$BIN_DIR/dart"
+
+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
+
+if [ -t 2 ]; then # Only print warning when run in terminal.
+  >&2 echo 'The top level `pub` command is deprecated. Use `dart pub` instead.'
+fi
+
+# Forward to the `dart __deprecatedpub` command.
+exec "$DART" "${VM_OPTIONS[@]}" __deprecated_pub "$@"
diff --git a/sdk/bin/pub_sdk.bat b/sdk/bin/pub_sdk.bat
new file mode 100644
index 0000000..e882aac
--- /dev/null
+++ b/sdk/bin/pub_sdk.bat
@@ -0,0 +1,50 @@
+@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
+  )
+)
+
+echo "The top level `pub.bat` command is deprecated. Use `dart pub` instead." 1>&2
+"%BIN_DIR%\dart" %VM_OPTIONS% __deprecated_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/tools/VERSION b/tools/VERSION
index b70f26b..6eccc8d 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 17
 PATCH 0
-PRERELEASE 91
+PRERELEASE 92
 PRERELEASE_PATCH 0
\ No newline at end of file
diff --git a/tools/bots/pub_integration_test.py b/tools/bots/pub_integration_test.py
index 4f35ae6..f80c554 100755
--- a/tools/bots/pub_integration_test.py
+++ b/tools/bots/pub_integration_test.py
@@ -35,10 +35,10 @@
     mode = ('Debug' if options.mode == 'debug' else 'Release')
 
     out_dir = 'xcodebuild' if sys.platform == 'darwin' else 'out'
-    extension = '' if not sys.platform == 'win32' else '.exe'
-    dart = os.path.abspath('%s/%s%s/dart-sdk/bin/dart%s' %
-                           (out_dir, mode, arch, extension))
-    print(dart)
+    extension = '' if not sys.platform == 'win32' else '.bat'
+    pub = os.path.abspath('%s/%s%s/dart-sdk/bin/pub%s' %
+                          (out_dir, mode, arch, extension))
+    print(pub)
 
     working_dir = tempfile.mkdtemp()
     try:
@@ -49,15 +49,11 @@
         with open(working_dir + '/pubspec.yaml', 'w') as pubspec_yaml:
             pubspec_yaml.write(PUBSPEC)
 
-        exit_code = subprocess.call([dart, 'pub', 'get'],
-                                    cwd=working_dir,
-                                    env=env)
+        exit_code = subprocess.call([pub, 'get'], cwd=working_dir, env=env)
         if exit_code != 0:
             return exit_code
 
-        exit_code = subprocess.call([dart, 'pub', 'upgrade'],
-                                    cwd=working_dir,
-                                    env=env)
+        exit_code = subprocess.call([pub, 'upgrade'], cwd=working_dir, env=env)
         if exit_code != 0:
             return exit_code
     finally: