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

Unified Diff: runtime/lib/errors_patch.dart

Issue 2073623002: Simplify generated code for assert() (Closed) Base URL: git@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 | « runtime/lib/errors.cc ('k') | runtime/vm/parser.h » ('j') | no next file with comments »
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 8c995a4d146537d169781e1a088bdb710545f0e2..faf342b66a1db9ba2e1dac802b1699d78182c846 100644
--- a/runtime/lib/errors_patch.dart
+++ b/runtime/lib/errors_patch.dart
@@ -26,9 +26,13 @@ class _AssertionError extends Error implements AssertionError {
static _throwNew(int assertionStart, int assertionEnd)
native "AssertionError_throwNew";
- static _handleCondition(condition) {
- if (condition is Function) return condition();
- return condition;
+ static void _checkAssertion(condition, int start, int end) {
+ if (condition is Function) {
+ condition = condition();
+ }
+ if (!condition) {
+ _throwNew(start, end);
+ }
}
String toString() {
« no previous file with comments | « runtime/lib/errors.cc ('k') | runtime/vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698