Commits

Richard Feldman committed 7a73a88

Added explicit error handling for null and undefined types.

Comments (0)

Files changed (1)

src/typeinference.js

         return type;
     } else if(type instanceof t.BooleanType) {
         return type;
+    } else if(type === undefined) {
+        throw new Error("Not handled: undefined type");
+    } else if(type === null) {
+        throw new Error("Not handled: null type");
     }
     throw new Error("Not handled: " + type.toString());
 }