(data, Ctor, tag)
| 3166 | } |
| 3167 | |
| 3168 | function extractProps (data, Ctor, tag) { |
| 3169 | // we are only extracting raw values here. |
| 3170 | // validation and default values are handled in the child |
| 3171 | // component itself. |
| 3172 | var propOptions = Ctor.options.props; |
| 3173 | if (!propOptions) { |
| 3174 | return |
| 3175 | } |
| 3176 | var res = {}; |
| 3177 | var attrs = data.attrs; |
| 3178 | var props = data.props; |
| 3179 | var domProps = data.domProps; |
| 3180 | if (attrs || props || domProps) { |
| 3181 | for (var key in propOptions) { |
| 3182 | var altKey = hyphenate(key); |
| 3183 | { |
| 3184 | var keyInLowerCase = key.toLowerCase(); |
| 3185 | if ( |
| 3186 | key !== keyInLowerCase && |
| 3187 | attrs && attrs.hasOwnProperty(keyInLowerCase) |
| 3188 | ) { |
| 3189 | tip( |
| 3190 | "Prop \"" + keyInLowerCase + "\" is passed to component " + |
| 3191 | (formatComponentName(tag || Ctor)) + ", but the declared prop name is" + |
| 3192 | " \"" + key + "\". " + |
| 3193 | "Note that HTML attributes are case-insensitive and camelCased " + |
| 3194 | "props need to use their kebab-case equivalents when using in-DOM " + |
| 3195 | "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"." |
| 3196 | ); |
| 3197 | } |
| 3198 | } |
| 3199 | checkProp(res, props, key, altKey, true) || |
| 3200 | checkProp(res, attrs, key, altKey) || |
| 3201 | checkProp(res, domProps, key, altKey); |
| 3202 | } |
| 3203 | } |
| 3204 | return res |
| 3205 | } |
| 3206 | |
| 3207 | function checkProp ( |
| 3208 | res, |
no test coverage detected