code: function validate(key, val, spec) {
          var type = typeof_(val);
  
          // Constants
          if (type === 'string' && val[0] === '@') {
              if (!(val in constants)) {
                  return error(key, val, 'constant "%s" not found', val);
              }
              val = constants[val];
              type = typeof_(val);
          }
  
          // Functions
          if (spec.function && type === 'object') {
              return validate.function(key, val, spec);
          }
  
          if (spec.type) {
              var validator = validate[spec.type];
              if (validator) {
                  return validator(key, val, spec);
              }
              spec = reference[spec.type];
          }
  
          validate.object(key, val, spec);
      }
docs: Main recursive validation function. Tracks:  - key: string representing location of validation in style tree. Used only for more informative error reporting. - val: current value from style being evaluated. May be anything from a high level object that needs to be descended into deeper or a simple scalar value. - spec: current spec being evaluated. Tracks val.