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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart

Issue 2971243003: fix #30094, assert should work with a function (Closed)
Patch Set: 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
« no previous file with comments | « pkg/dev_compiler/test/browser/language_tests.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
index 835ead6f55a006461877ef6cb31680a4c128fc5c..c7a5d0d963c5ae8844b203e4e63d1d3d67a4ec7b 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
@@ -701,11 +701,9 @@ map(values, [K, V]) => JS(
})()''');
@JSExportName('assert')
-assert_(condition, [message]) => JS(
- '',
- '''(() => {
- if (!$condition) $throwAssertionError(message);
-})()''');
+assert_(condition, message) {
+ if (JS('bool', '!#', condition)) throwAssertionError(message);
vsm 2017/07/07 12:38:47 If the static type of condition is `dynamic`, we w
+}
/// Store a JS error for an exception. For non-primitives, we store as an
/// expando. For primitive, we use a side cache. To limit memory leakage, we
« no previous file with comments | « pkg/dev_compiler/test/browser/language_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698