fc25b8028f20 — Laurens Holst 10 years ago
Report the correct index in checkTypes().
1 files changed, 1 insertions(+), 1 deletions(-)

M src/grauw-lib.js
M src/grauw-lib.js +1 -1
@@ 51,7 51,7 @@ 
 					!(type instanceof Function && arg instanceof type)) {
 				if (typeof type != "string" && !(type instanceof Function))
 					throw new Error("Unsupported type " + type + ".");
-				throw new Error("Argument of type " + (typeof type != "string" && type.constructor.name || type) + " expected at index " + i + ". " +
+				throw new Error("Argument of type " + (typeof type != "string" && type.constructor.name || type) + " expected at index " + (i - 1) + ". " +
 						"Was: " + (arg && typeof arg != "string" && arg.constructor && arg.constructor.name || arg) + ".");
 			}
 		}