Explorar o código

safer isNative check (fix #5361)

Evan You %!s(int64=9) %!d(string=hai) anos
pai
achega
9311876c7c
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/core/util/env.js

+ 2 - 2
src/core/util/env.js

@@ -37,8 +37,8 @@ export const isServerRendering = () => {
 export const devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__
 
 /* istanbul ignore next */
-export function isNative (Ctor: Function): boolean {
-  return /native code/.test(Ctor.toString())
+export function isNative (Ctor: any): boolean {
+  return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
 }
 
 export const hasSymbol =