Index: sdk/lib/_internal/js_runtime/lib/js_helper.dart |
diff --git a/sdk/lib/_internal/js_runtime/lib/js_helper.dart b/sdk/lib/_internal/js_runtime/lib/js_helper.dart |
index 4af360bd8a3302a5d7c471d6760c47ae75d83810..663121a605f99407676a7468c2bd6fe0ce0044ee 100644 |
--- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart |
+++ b/sdk/lib/_internal/js_runtime/lib/js_helper.dart |
@@ -4014,3 +4014,17 @@ class _AssertionError extends AssertionError { |
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"; |
+} |
+ |
+@NoInline() |
+void assertUnreachable() { |
+ throw new _UnreachableError(); |
+} |