| Index: frog/gen.dart
|
| diff --git a/frog/gen.dart b/frog/gen.dart
|
| index 53f512405cf37366733c28d5f6d1ddaad31ac6f8..807e2f13cda25cf2894022dd097c5aa9f664c2e0 100644
|
| --- a/frog/gen.dart
|
| +++ b/frog/gen.dart
|
| @@ -107,6 +107,10 @@ class WorldGenerator {
|
| }
|
| }
|
| }
|
| + // Type check functions for builtin JS types
|
| + if (type.typeCheckCode != null) {
|
| + writer.writeln(type.typeCheckCode);
|
| + }
|
| }
|
| }
|
|
|
| @@ -185,8 +189,8 @@ class WorldGenerator {
|
| }
|
| }
|
|
|
| - // Concrete types (like List<String>) will this already defined on their
|
| - // prototype from the generic type (like List)
|
| + // Concrete types (like List<String>) will have this already defined on
|
| + // their prototype from the generic type (like List)
|
| if (type is! ConcreteType) {
|
| _maybeIsTest(type, type);
|
| }
|
| @@ -948,7 +952,12 @@ class MethodGenerator implements TreeVisitor {
|
| }
|
|
|
| visitBool(Expression node) {
|
| - return visitTypedValue(node, world.boolType);
|
| + // Boolean conversions in if/while/do/for/conditions require non-null bool.
|
| +
|
| + // TODO(jmesserly): why do we have this rule? It seems inconsistent with
|
| + // the rest of the type system, and just causes bogus asserts unless all
|
| + // bools are initialized to false.
|
| + return visitValue(node).convertToNonNullBool(this, node);
|
| }
|
|
|
| visitValue(Expression node) {
|
|
|