Skip to content

Commit 4746256

Browse files
william-panyyx990803
authored andcommitted
refactor: use util.isNative to check native Proxy (#7549)
1 parent f2b476d commit 4746256

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: src/core/instance/proxy.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* not type checking this file because flow doesn't play well with Proxy */
22

33
import config from 'core/config'
4-
import { warn, makeMap } from '../util/index'
4+
import { warn, makeMap, isNative } from '../util/index'
55

66
let initProxy
77

@@ -25,8 +25,7 @@ if (process.env.NODE_ENV !== 'production') {
2525
}
2626

2727
const hasProxy =
28-
typeof Proxy !== 'undefined' &&
29-
Proxy.toString().match(/native code/)
28+
typeof Proxy !== 'undefined' && isNative(Proxy)
3029

3130
if (hasProxy) {
3231
const isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact')

0 commit comments

Comments
 (0)