refactor: use global whitelist for render proxy has check

This commit is contained in:
Evan You
2019-10-02 10:37:06 -04:00
parent d87255ce46
commit 191db785bd
4 changed files with 20 additions and 23 deletions

View File

@@ -0,0 +1,7 @@
export const globalsWhitelist = new Set(
(
'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +
'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +
'Object,Boolean,String,RegExp,Map,Set,JSON,Intl'
).split(',')
)

View File

@@ -1,4 +1,5 @@
export * from './patchFlags'
export { globalsWhitelist } from './globalsWhitelist'
export const EMPTY_OBJ: { readonly [key: string]: any } = __DEV__
? Object.freeze({})