add error for too many builder method args

This commit is contained in:
Sebastian McKenzie 2015-11-03 01:20:17 +00:00
parent 06afafa8ff
commit 85dd7ec40e

View File

@ -133,7 +133,7 @@ export function isType(nodeType: string, targetType: string): boolean {
each(t.BUILDER_KEYS, function (keys, type) {
function builder() {
if (arguments.length > keys.length) {
// todo: error
throw new Error(`t.${type}: Too many arguments passed. Received ${arguments.length} but can receive no more than ${keys.length}`);
}
let node = {};