Version 2.15.0-197.0.dev

Merge commit 'de45656da1885cbc761fb45e8f63cef0ae6ba52a' into 'dev'
diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json
index d282df6..1c58ea1 100644
--- a/.dart_tool/package_config.json
+++ b/.dart_tool/package_config.json
@@ -623,7 +623,7 @@
       "name": "source_maps",
       "rootUri": "../third_party/pkg/source_maps",
       "packageUri": "lib/",
-      "languageVersion": "2.10"
+      "languageVersion": "2.12"
     },
     {
       "name": "source_span",
diff --git a/DEPS b/DEPS
index 72abd08..b8a13eb 100644
--- a/DEPS
+++ b/DEPS
@@ -150,7 +150,7 @@
   "shelf_web_socket_rev": "24fb8a04befa75a94ac63a27047b231d1a22aab4",
   "source_map_stack_trace_rev": "1c3026f69d9771acf2f8c176a1ab750463309cce",
   "source_maps-0.9.4_rev": "38524",
-  "source_maps_rev": "53eb92ccfe6e64924054f83038a534b959b12b3e",
+  "source_maps_rev": "6499ee3adac8d469e2953e2e8ba4bdb4c2fbef90",
   "source_span_rev": "1be3c44045a06dff840d2ed3a13e6082d7a03a23",
   "sse_rev": "9084339389eb441d0c0518cddac211a097e78657",
   "stack_trace_rev": "6788afc61875079b71b3d1c3e65aeaa6a25cbc2f",
diff --git a/pkg/dart2js_tools/pubspec.yaml b/pkg/dart2js_tools/pubspec.yaml
index 0d28868..a6a46fe 100644
--- a/pkg/dart2js_tools/pubspec.yaml
+++ b/pkg/dart2js_tools/pubspec.yaml
@@ -6,7 +6,7 @@
   information, deobfuscation of stack-traces and minified names.
 dependencies:
   path: any
-  source_maps: ^0.10.7
+  source_maps: ^0.10.10
   source_span: any
   stack_trace: ^1.9.3
 environment:
diff --git a/runtime/bin/process.cc b/runtime/bin/process.cc
index 8b5c402..3371314 100644
--- a/runtime/bin/process.cc
+++ b/runtime/bin/process.cc
@@ -319,8 +319,8 @@
   char* str = StringUtils::ConsoleStringToUtf8(reinterpret_cast<char*>(buffer),
                                                bytes_length, &len);
   if (str == NULL) {
-    Dart_ThrowException(
-        DartUtils::NewInternalError("SystemEncodingToString failed"));
+    Dart_ThrowException(DartUtils::NewDartUnsupportedError(
+        "SystemEncodingToString not supported on this operating system"));
   }
   result = Dart_NewStringFromUTF8(reinterpret_cast<const uint8_t*>(str), len);
   ThrowIfError(result);
@@ -338,8 +338,8 @@
   const char* system_string =
       StringUtils::Utf8ToConsoleString(utf8, utf8_len, &system_len);
   if (system_string == NULL) {
-    Dart_ThrowException(
-        DartUtils::NewInternalError("StringToSystemEncoding failed"));
+    Dart_ThrowException(DartUtils::NewDartUnsupportedError(
+        "StringToSystemEncoding not supported on this operating system"));
   }
   uint8_t* buffer = NULL;
   Dart_Handle external_array = IOBuffer::Allocate(system_len, &buffer);
diff --git a/runtime/bin/utils.h b/runtime/bin/utils.h
index 5f5a1cc..ab7b1c1 100644
--- a/runtime/bin/utils.h
+++ b/runtime/bin/utils.h
@@ -67,8 +67,8 @@
   // character. If result_len is not NUL, it is used to set the number
   // of characters in the result.
   //
-  // These conversion functions are only implemented on Windows as the
-  // Dart code only hit this path on Windows.
+  // A return value of `nullptr` indicates that the conversion is not supported,
+  // which is true on all platforms other than Windows.
   static const char* ConsoleStringToUtf8(const char* str,
                                          intptr_t len = -1,
                                          intptr_t* result_len = NULL);
diff --git a/runtime/bin/utils_android.cc b/runtime/bin/utils_android.cc
index 53a4cec..89002ab 100644
--- a/runtime/bin/utils_android.cc
+++ b/runtime/bin/utils_android.cc
@@ -43,28 +43,24 @@
 const char* StringUtils::ConsoleStringToUtf8(const char* str,
                                              intptr_t len,
                                              intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
 const char* StringUtils::Utf8ToConsoleString(const char* utf8,
                                              intptr_t len,
                                              intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
 char* StringUtils::ConsoleStringToUtf8(char* str,
                                        intptr_t len,
                                        intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
 char* StringUtils::Utf8ToConsoleString(char* utf8,
                                        intptr_t len,
                                        intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
diff --git a/runtime/bin/utils_fuchsia.cc b/runtime/bin/utils_fuchsia.cc
index f034e87..3053550 100644
--- a/runtime/bin/utils_fuchsia.cc
+++ b/runtime/bin/utils_fuchsia.cc
@@ -41,28 +41,24 @@
 const char* StringUtils::ConsoleStringToUtf8(const char* str,
                                              intptr_t len,
                                              intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
 const char* StringUtils::Utf8ToConsoleString(const char* utf8,
                                              intptr_t len,
                                              intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
 char* StringUtils::ConsoleStringToUtf8(char* str,
                                        intptr_t len,
                                        intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
 char* StringUtils::Utf8ToConsoleString(char* utf8,
                                        intptr_t len,
                                        intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
diff --git a/runtime/bin/utils_linux.cc b/runtime/bin/utils_linux.cc
index 9c9ad3a..5e18730 100644
--- a/runtime/bin/utils_linux.cc
+++ b/runtime/bin/utils_linux.cc
@@ -42,28 +42,24 @@
 const char* StringUtils::ConsoleStringToUtf8(const char* str,
                                              intptr_t len,
                                              intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
 const char* StringUtils::Utf8ToConsoleString(const char* utf8,
                                              intptr_t len,
                                              intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
 char* StringUtils::ConsoleStringToUtf8(char* str,
                                        intptr_t len,
                                        intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
 char* StringUtils::Utf8ToConsoleString(char* utf8,
                                        intptr_t len,
                                        intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
diff --git a/runtime/bin/utils_macos.cc b/runtime/bin/utils_macos.cc
index 219d643..d9f4f46 100644
--- a/runtime/bin/utils_macos.cc
+++ b/runtime/bin/utils_macos.cc
@@ -46,28 +46,24 @@
 const char* StringUtils::ConsoleStringToUtf8(const char* str,
                                              intptr_t len,
                                              intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
 const char* StringUtils::Utf8ToConsoleString(const char* utf8,
                                              intptr_t len,
                                              intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
 char* StringUtils::ConsoleStringToUtf8(char* str,
                                        intptr_t len,
                                        intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
 char* StringUtils::Utf8ToConsoleString(char* utf8,
                                        intptr_t len,
                                        intptr_t* result_len) {
-  UNIMPLEMENTED();
   return NULL;
 }
 
diff --git a/tests/standalone/io/issue_46436_test.dart b/tests/standalone/io/issue_46436_test.dart
new file mode 100644
index 0000000..bbc5800
--- /dev/null
+++ b/tests/standalone/io/issue_46436_test.dart
@@ -0,0 +1,47 @@
+// Copyright (c) 2021, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// Checks that _WindowsCodePageEncoder.convert() throws an exception on
+// platforms other than Windows.
+
+import "dart:io";
+import 'dart:mirrors';
+
+import "package:expect/expect.dart";
+
+ClassMirror findWindowsCodePageEncoder() {
+  final dartIo =
+      currentMirrorSystem().libraries[Uri(scheme: "dart", path: "io")];
+  if (dartIo == null) {
+    throw StateError("dart:io not present");
+  }
+
+  final classes = dartIo.declarations.values
+      .where((d) =>
+          d is ClassMirror &&
+          d.simpleName.toString().contains('"_WindowsCodePageEncoder"'))
+      .map((d) => d as ClassMirror)
+      .toList();
+
+  Expect.equals(
+      1, classes.length, "Expected exactly one _WindowsCodePageEncoder");
+  return classes[0];
+}
+
+test() {
+  final winCodePageEncoder = findWindowsCodePageEncoder();
+  final encoder = winCodePageEncoder.newInstance(Symbol(""), List.empty());
+  try {
+    encoder.invoke(Symbol("convert"), List.of(["test"]));
+    Expect.isTrue(Platform.isWindows,
+        "expected UnsupportedError on ${Platform.operatingSystem}");
+  } on UnsupportedError catch (e) {
+    Expect.isFalse(
+        Platform.isWindows, "unexpected UnsupportedError on Windows: $e");
+  }
+}
+
+void main() {
+  test();
+}
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index 9f62999..1c9d7d1 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -56,6 +56,7 @@
 [ $runtime == dart_precompiled ]
 http_launch_test: Skip
 io/addlatexhash_test: Skip
+io/issue_46436_test: SkipByDesign # Uses mirrors.
 io/socket_sigpipe_test: SkipByDesign # Spawns server process using Platform.executable
 io/wait_for_event_isolate_test: SkipByDesign # Uses mirrors.
 io/wait_for_event_microtask_test: SkipByDesign # Uses mirrors.
diff --git a/tests/standalone_2/io/issue_46436_test.dart b/tests/standalone_2/io/issue_46436_test.dart
new file mode 100644
index 0000000..f94b11b
--- /dev/null
+++ b/tests/standalone_2/io/issue_46436_test.dart
@@ -0,0 +1,49 @@
+// Copyright (c) 2021, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// Checks that _WindowsCodePageEncoder.convert() throws an exception on
+// platforms other than Windows.
+
+// @dart = 2.9
+
+import "dart:io";
+import 'dart:mirrors';
+
+import "package:expect/expect.dart";
+
+ClassMirror findWindowsCodePageEncoder() {
+  final dartIo =
+      currentMirrorSystem().libraries[Uri(scheme: "dart", path: "io")];
+  if (dartIo == null) {
+    throw StateError("dart:io not present");
+  }
+
+  final classes = dartIo.declarations.values
+      .where((d) =>
+          d is ClassMirror &&
+          d.simpleName.toString().contains('"_WindowsCodePageEncoder"'))
+      .map((d) => d as ClassMirror)
+      .toList();
+
+  Expect.equals(
+      1, classes.length, "Expected exactly one _WindowsCodePageEncoder");
+  return classes[0];
+}
+
+test() {
+  final winCodePageEncoder = findWindowsCodePageEncoder();
+  final encoder = winCodePageEncoder.newInstance(Symbol(""), List.empty());
+  try {
+    encoder.invoke(Symbol("convert"), List.of(["test"]));
+    Expect.isTrue(Platform.isWindows,
+        "expected UnsupportedError on ${Platform.operatingSystem}");
+  } on UnsupportedError catch (e) {
+    Expect.isFalse(
+        Platform.isWindows, "unexpected UnsupportedError on Windows: $e");
+  }
+}
+
+void main() {
+  test();
+}
diff --git a/tests/standalone_2/standalone_2.status b/tests/standalone_2/standalone_2.status
index 6a27a9c..6b785dd 100644
--- a/tests/standalone_2/standalone_2.status
+++ b/tests/standalone_2/standalone_2.status
@@ -56,6 +56,7 @@
 [ $runtime == dart_precompiled ]
 http_launch_test: Skip
 io/addlatexhash_test: Skip
+io/issue_46436_test: SkipByDesign # Uses mirrors.
 io/socket_sigpipe_test: SkipByDesign # Spawns server process using Platform.executable
 io/wait_for_event_isolate_test: SkipByDesign # Uses mirrors.
 io/wait_for_event_microtask_test: SkipByDesign # Uses mirrors.
diff --git a/tools/VERSION b/tools/VERSION
index 75b191a..9447bf5 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 15
 PATCH 0
-PRERELEASE 196
+PRERELEASE 197
 PRERELEASE_PATCH 0
\ No newline at end of file