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

Unified Diff: sdk/lib/_internal/compiler/implementation/compiler.dart

Issue 13467021: Register type for literal list/map. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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: sdk/lib/_internal/compiler/implementation/compiler.dart
diff --git a/sdk/lib/_internal/compiler/implementation/compiler.dart b/sdk/lib/_internal/compiler/implementation/compiler.dart
index 2f7fa15cfd890927c8f852c94ff30118abd6b629..a8566268e4d5da685238aa103dc2fed66bc3995c 100644
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -1251,13 +1251,16 @@ class SourceSpan {
* [spannable] must be non-null and will be used to provide positional
* information in the generated error message.
*/
-bool invariant(Spannable spannable, var condition, {String message: null}) {
+bool invariant(Spannable spannable, var condition, {var message: null}) {
// TODO(johnniwinther): Use [spannable] and [message] to provide better
// information on assertion errors.
if (condition is Function){
condition = condition();
}
if (spannable == null || !condition) {
+ if (message is Function) {
+ message = message();
+ }
throw new SpannableAssertionFailure(spannable, message);
}
return true;

Powered by Google App Engine
This is Rietveld 408576698