mirror of
https://github.com/vuejs/vue.git
synced 2024-11-21 20:28:54 +00:00
fix(compiler): Allow BigInt usage in templates (#11152)
This commit is contained in:
parent
69401311f4
commit
c42b7066ca
@ -9,7 +9,7 @@ if (process.env.NODE_ENV !== 'production') {
|
||||
const allowedGlobals = makeMap(
|
||||
'Infinity,undefined,NaN,isFinite,isNaN,' +
|
||||
'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
|
||||
'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
|
||||
'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' +
|
||||
'require' // for Webpack/Browserify
|
||||
)
|
||||
|
||||
|
@ -194,4 +194,11 @@ describe('Filters', () => {
|
||||
it('support template string', () => {
|
||||
expect(parseFilters('`a | ${b}c` | d')).toBe('_f("d")(`a | ${b}c`)')
|
||||
})
|
||||
|
||||
it('bigint support', () => {
|
||||
const vm = new Vue({
|
||||
template: `<div>{{ BigInt(BigInt(10000000)) + BigInt(2000000000n) * 3000000n }}</div>`
|
||||
}).$mount()
|
||||
expect(vm.$el.textContent).toBe('6000000010000000')
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user