fix prop type in IE9

This commit is contained in:
Evan You 2016-08-11 00:24:30 -05:00
parent a88e233f89
commit 8367d489e0
1 changed files with 7 additions and 7 deletions

View File

@ -4,12 +4,12 @@ import { hasOwn, isObject, isPlainObject, capitalize, hyphenate } from 'shared/u
import { observe, observerState } from '../observer/index' import { observe, observerState } from '../observer/index'
import { warn } from './debug' import { warn } from './debug'
// type PropOptions = { type PropOptions = {
// type: Function | Array<Function> | null, type: Function | Array<Function> | null,
// default: any, default: any,
// required: ?boolean, required: ?boolean,
// validator: ?Function validator: ?Function
// } }
export function validateProp ( export function validateProp (
key: string, key: string,
@ -159,6 +159,6 @@ function assertType (value: any, type: Function): {
* across different vms / iframes. * across different vms / iframes.
*/ */
function getType (fn) { function getType (fn) {
const match = fn && fn.toString().match(/^function (\w+)/) const match = fn && fn.toString().match(/^\s*function (\w+)/)
return match && match[1] return match && match[1]
} }