fix(ref-transform): not transform the prototype attributes. (#4503)

fix #4502
This commit is contained in:
ygj6
2021-09-06 05:35:13 +08:00
committed by GitHub
parent 12acf5102c
commit 0178f4ed31
2 changed files with 10 additions and 2 deletions

View File

@@ -395,4 +395,12 @@ describe('errors', () => {
`$computed can only be used as the initializer`
)
})
test('not transform the prototype attributes', () => {
const { code } = transform(`
const hasOwnProperty = Object.prototype.hasOwnProperty
const hasOwn = (val, key) => hasOwnProperty.call(val, key)
`)
expect(code).not.toMatch('.value')
})
})