fix(runtime-core): fix component proxy props presence check

fix #864
This commit is contained in:
Evan You
2020-03-21 16:25:33 -04:00
parent c3bb3169f4
commit b3890a93e3
3 changed files with 22 additions and 14 deletions

View File

@@ -175,4 +175,18 @@ describe('component: proxy', () => {
instanceProxy.baz = 1
expect('baz' in instanceProxy).toBe(true)
})
// #864
test('should not warn declared but absent props', () => {
const Comp = {
props: ['test'],
render(this: any) {
return this.test
}
}
render(h(Comp), nodeOps.createElement('div'))
expect(
`was accessed during render but is not defined`
).not.toHaveBeenWarned()
})
})