From 55455160e132d93ba62906993a551078dad4dfd8 Mon Sep 17 00:00:00 2001 From: william-pan Date: Sun, 28 Jan 2018 23:15:41 +0800 Subject: [PATCH] Use util.isNative to remove duplicated code --- src/core/instance/proxy.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/instance/proxy.js b/src/core/instance/proxy.js index 7454712f994..0d6dcf80639 100644 --- a/src/core/instance/proxy.js +++ b/src/core/instance/proxy.js @@ -1,7 +1,7 @@ /* not type checking this file because flow doesn't play well with Proxy */ import config from 'core/config' -import { warn, makeMap } from '../util/index' +import { warn, makeMap, isNative } from '../util/index' let initProxy @@ -25,8 +25,7 @@ if (process.env.NODE_ENV !== 'production') { } const hasProxy = - typeof Proxy !== 'undefined' && - Proxy.toString().match(/native code/) + typeof Proxy !== 'undefined' && isNative(Proxy) if (hasProxy) { const isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact')