Skip to content

Commit 8e1478e

Browse files
committed
proxy: allow keys that start with _ to fall through (necessary for babel helpers)
1 parent e965298 commit 8e1478e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/instance/proxy.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (process.env.NODE_ENV !== 'production') {
99
'Infinity,undefined,NaN,isFinite,isNaN,' +
1010
'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
1111
'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
12-
'require,__webpack_require__' // for Webpack/Browserify
12+
'require' // for Webpack/Browserify
1313
)
1414

1515
hasProxy =
@@ -19,16 +19,16 @@ if (process.env.NODE_ENV !== 'production') {
1919
proxyHandlers = {
2020
has (target, key) {
2121
const has = key in target
22-
const isAllowedGlobal = allowedGlobals(key)
23-
if (!has && !isAllowedGlobal) {
22+
const isAllowed = allowedGlobals(key) || key.charAt(0) === '_'
23+
if (!has && !isAllowed) {
2424
warn(
2525
`Property or method "${key}" is not defined on the instance but ` +
2626
`referenced during render. Make sure to declare reactive data ` +
2727
`properties in the data option.`,
2828
target
2929
)
3030
}
31-
return !isAllowedGlobal
31+
return has || !isAllowed
3232
}
3333
}
3434

0 commit comments

Comments
 (0)