diff --git a/test/unit/features/options/inject.spec.js b/test/unit/features/options/inject.spec.js index cd5c7097f31..53f55e1ecf2 100644 --- a/test/unit/features/options/inject.spec.js +++ b/test/unit/features/options/inject.spec.js @@ -635,4 +635,16 @@ describe('Options provide/inject', () => { expect(injected).toEqual('foo') }) + + // #7284 + it('should not inject prototype properties', () => { + const vm = new Vue({ + provide: {} + }) + new Vue({ + parent: vm, + inject: ['constructor'] + }) + expect(`Injection "constructor" not found`).toHaveBeenWarned() + }) })