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

Unified Diff: runtime/lib/errors_patch.dart

Issue 2064663002: Make VM accept function values in assert statements. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | runtime/vm/parser.h » ('j') | runtime/vm/parser.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/errors_patch.dart
diff --git a/runtime/lib/errors_patch.dart b/runtime/lib/errors_patch.dart
index 98814f8dff413ca96567b8366a1d8f46d06133ee..8c995a4d146537d169781e1a088bdb710545f0e2 100644
--- a/runtime/lib/errors_patch.dart
+++ b/runtime/lib/errors_patch.dart
@@ -26,6 +26,11 @@ class _AssertionError extends Error implements AssertionError {
static _throwNew(int assertionStart, int assertionEnd)
native "AssertionError_throwNew";
+ static _handleCondition(condition) {
hausner 2016/06/14 17:51:31 I'd call this function _evaluateCondition(), or so
+ if (condition is Function) return condition();
+ return condition;
+ }
+
String toString() {
if (_url == null) {
return _failedAssertion;
« no previous file with comments | « no previous file | runtime/vm/parser.h » ('j') | runtime/vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698