diff --git a/src/verifier.js b/src/verifier.js index b5ddc29ad..d58e27abe 100644 --- a/src/verifier.js +++ b/src/verifier.js @@ -31,10 +31,11 @@ function genVerifyValue(gen, field, fieldIndex, ref) { ("}"); } else { gen - ((gen.hasErrorVar ? "" : "var ") + "e=types[%i].verify(%s);", fieldIndex, ref) - ("if(e)") - ("return%j+e", field.name + "."); - gen.hasErrorVar = true; + ("{") + ("var e=types[%i].verify(%s);", fieldIndex, ref) + ("if(e)") + ("return%j+e", field.name + ".") + ("}"); } } else { switch (field.type) {