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

Unified Diff: frog/value.dart

Issue 8590017: Fix "is Object" to always be true in Dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: take2 after syncing Created 9 years, 1 month 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 | « frog/type.dart ('k') | tests/co19/co19-frog.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/value.dart
diff --git a/frog/value.dart b/frog/value.dart
index 684fecbcde3c10617ac0577a3a171089fcb6e765..4466f3f3fb9d916b9e998cb46e3b054e9703ad8a 100644
--- a/frog/value.dart
+++ b/frog/value.dart
@@ -391,16 +391,21 @@ function \$assert_${toType.name}(x) {
[bool isTrue=true, bool forceCheck=false]) {
// TODO(jimhug): Optimize away tests that will always pass unless
// forceCheck is true.
+
if (toType.isVar) {
world.error('can not resolve type', span);
- return new EvaluatedValue(world.nonNullBool, true, 'true', null);
}
- if (toType is ParameterType) {
- return new EvaluatedValue(world.nonNullBool, true, 'true', null);
+ String testCode = null;
+ if (toType.isVar || toType.isObject || toType is ParameterType) {
+ // Note: everything is an Object, including null.
+ if (needsTemp) {
+ return new Value(world.nonNullBool, '($code, true)', span);
Siggi Cherem (dart-lang) 2011/11/17 16:55:57 can you explain to me a bit more ($code, true)? is
Jennifer Messerly 2011/11/17 18:18:51 Yes, exactly.
+ } else {
+ return new EvaluatedValue(world.nonNullBool, true, 'true', null);
+ }
}
- String testCode = null;
if (toType.library.isCore) {
var typeofName = toType.typeofName;
if (typeofName != null) {
« no previous file with comments | « frog/type.dart ('k') | tests/co19/co19-frog.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698