diff --git a/src/core/util/props.js b/src/core/util/props.js index 647813c5393..5a90f21b5f0 100644 --- a/src/core/util/props.js +++ b/src/core/util/props.js @@ -147,7 +147,7 @@ function assertProp ( } } -const simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/ +const simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/ function assertType (value: any, type: Function, vm: ?Component): { valid: boolean; diff --git a/test/unit/features/options/props.spec.js b/test/unit/features/options/props.spec.js index 94c03f1ec9f..2ada45a0553 100644 --- a/test/unit/features/options/props.spec.js +++ b/test/unit/features/options/props.spec.js @@ -252,6 +252,16 @@ describe('Options props', () => { expect('Expected String, Number, got Symbol').toHaveBeenWarned() }) } + + if (typeof BigInt !== 'undefined') { + /* global BigInt */ + it('bigint', () => { + makeInstance(BigInt(100), BigInt) + expect(console.error.calls.count()).toBe(0) + makeInstance({}, BigInt) + expect('Expected BigInt, got Object').toHaveBeenWarned() + }) + } it('custom constructor', () => { function Class () {}