From 8367d489e02e5d5e965f17558aac908f71bf843c Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 11 Aug 2016 00:24:30 -0500 Subject: [PATCH] fix prop type in IE9 --- src/core/util/props.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/util/props.js b/src/core/util/props.js index 36f4fd739..5cf5e1667 100644 --- a/src/core/util/props.js +++ b/src/core/util/props.js @@ -4,12 +4,12 @@ import { hasOwn, isObject, isPlainObject, capitalize, hyphenate } from 'shared/u import { observe, observerState } from '../observer/index' import { warn } from './debug' -// type PropOptions = { -// type: Function | Array | null, -// default: any, -// required: ?boolean, -// validator: ?Function -// } +type PropOptions = { + type: Function | Array | null, + default: any, + required: ?boolean, + validator: ?Function +} export function validateProp ( key: string, @@ -159,6 +159,6 @@ function assertType (value: any, type: Function): { * across different vms / iframes. */ function getType (fn) { - const match = fn && fn.toString().match(/^function (\w+)/) + const match = fn && fn.toString().match(/^\s*function (\w+)/) return match && match[1] }