Prismatic/schema — pull request #131 by krisajenkins (2014-08-04 09:20:21+00:00)
Title: Bugfix for defrecord - removing dead code at compile-time.

When using defrecord with schema 0.2.5+ & ClojureScript versions
*after* 2234, this is a common error:

WARNING: JSC_UNREACHABLE_CODE. unreachable code at .... line 1027 : 0

The reason seems to be that the newer Closure compiler has better
dead-code checking. Using defrecord without suppling an
extra-validator-fn? compiles down to something like:

if (null) { ...assert it's a function...}

...which the Closure compiler rightly warns is unreachable code.

This commit just changes the macro so that if we know there's no
extra-validator-fn? at compile time, we don't emit code to check it at
runtime.