Chromium Code Reviews| 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) { |