Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/js_helper.dart

Issue 2971243003: fix #30094, assert should work with a function (Closed)
Patch Set: fix Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/dev_compiler/tool/input_sdk/private/js_helper.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart b/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart
index 0017ebc9b16877df510e6ab71c831789f1b79945..3212539c5bfe89342af4400e6c14af63be8d5f61 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart
@@ -861,15 +861,12 @@ class RuntimeError extends Error {
String toString() => "RuntimeError: $message";
}
-/**
- * Error thrown when an assert() fails with a message:
- *
- * assert(false, "Message here");
- */
-class AssertionErrorWithMessage extends AssertionError {
- final Object _message;
- AssertionErrorWithMessage(this._message);
- String toString() => "Assertion failed: ${_message}";
+/// Error thrown by DDC when an `assert()` fails (with or without a message).
+class AssertionErrorImpl extends AssertionError {
+ AssertionErrorImpl(message) : super(message);
+ String toString() =>
+ "Assertion failed: " +
+ (message != null ? Error.safeToString(message) : "is not true");
Jennifer Messerly 2017/07/07 23:43:17 this uses Error.safeToString as dart2js does VM/d
}
/**

Powered by Google App Engine
This is Rietveld 408576698