We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55a30cf commit 2488a6aCopy full SHA for 2488a6a
src/core/util/props.js
@@ -174,13 +174,15 @@ function assertType (value: any, type: Function): {
174
}
175
176
177
+const functionTypeCheckRE = /^\s*function (\w+)/
178
+
179
/**
180
* Use function string name to check built-in types,
181
* because a simple equality check will fail when running
182
* across different vms / iframes.
183
*/
184
function getType (fn) {
- const match = fn && fn.toString().match(/^\s*function (\w+)/)
185
+ const match = fn && fn.toString().match(functionTypeCheckRE)
186
return match ? match[1] : ''
187
188
0 commit comments