Skip to content

Commit ae07fed

Browse files
committed
use inline function check
1 parent 4e98097 commit ae07fed

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/core/vdom/helpers/resolve-async-component.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import {
66
isDef,
77
isUndef,
88
isTrue,
9-
isObject,
10-
isFunction
9+
isObject
1110
} from 'core/util/index'
1211

1312
function ensureCtor (comp, base) {
@@ -70,12 +69,12 @@ export function resolveAsyncComponent (
7069
const res = factory(resolve, reject)
7170

7271
if (isObject(res)) {
73-
if (isFunction(res.then)) {
72+
if (typeof res.then === 'function') {
7473
// () => Promise
7574
if (isUndef(factory.resolved)) {
7675
res.then(resolve, reject)
7776
}
78-
} else if (isDef(res.component) && isFunction(res.component.then)) {
77+
} else if (isDef(res.component) && typeof res.component.then === 'function') {
7978
if (isDef(res.error)) {
8079
factory.errorComp = ensureCtor(res.error, baseCtor)
8180
}

src/shared/util.js

-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ export function isTrue (v: any): boolean {
1414
return v === true
1515
}
1616

17-
export function isFunction (v: any): boolean {
18-
return typeof v === 'function'
19-
}
20-
2117
/**
2218
* Convert a value to a string that is actually rendered.
2319
*/

0 commit comments

Comments
 (0)