Throw for invalid primitive types

This commit is contained in:
Jordan Eldredge 2019-06-26 18:58:23 -07:00
parent b3f9a68e8e
commit f4a087a9ed

View file

@ -127,9 +127,8 @@ class Parser {
case PRIMITIVE_TYPES[6]:
// This will likely get set by constants later on.
break;
}
if (value == null) {
// throw new Error("Failed to set value");
default:
throw new Error("Invalid primitive type");
}
const variable = new Variable({ ...props, type: { name: typeName } });
variable.setValue(value);