diff --git a/src/core/components/keep-alive.js b/src/core/components/keep-alive.js
index <HASH>..<HASH> 100644
--- a/src/core/components/keep-alive.js
+++ b/src/core/components/keep-alive.js
@@ -12,9 +12,10 @@ function getComponentName (opts: ?VNodeComponentOptions): ?string {
 function matches (pattern: string | RegExp, name: string): boolean {
   if (typeof pattern === 'string') {
     return pattern.split(',').indexOf(name) > -1
-  } else {
+  } else if (pattern instanceof RegExp) {
     return pattern.test(name)
   }
+  return false
 }
 
 function pruneCache (cache, filter) {
handle include/exclude changing to non-valid types (fix #<I>)