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

Unified Diff: runtime/lib/errors_patch.dart

Issue 2667353003: Skip the type test for expressions which have already evaluated to true or false. (Closed)
Patch Set: Created 3 years, 11 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 | no next file » | 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 69ae2195426a26a25a71c4346cb0d61cdf0e77a3..412f534ce7c13d0f71dd9a3306d79e20c04f9607 100644
--- a/runtime/lib/errors_patch.dart
+++ b/runtime/lib/errors_patch.dart
@@ -33,6 +33,9 @@ class _AssertionError extends Error implements AssertionError {
native "AssertionError_throwNew";
static _evaluateAssertion(condition) {
+ if (identical(condition, true) || identical(condition, false)) {
+ return condition;
+ }
if (condition is Function) {
rmacnak 2017/02/02 19:02:05 It might be worth adding if (condition is _Closur
Cutch 2017/02/02 19:57:49 Done.
condition = condition();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698