feat(types): mixins/extends support in TypeScript (#626)

This commit is contained in:
doly mood
2020-06-09 22:37:00 +08:00
committed by GitHub
parent 97dedebd80
commit d3c436ae2e
11 changed files with 656 additions and 56 deletions

View File

@@ -412,13 +412,13 @@ describe('reactivity/collections', () => {
`Reactive Set contains both the raw and reactive`
).toHaveBeenWarned()
})
it('thisArg', () => {
const raw = new Set([ 'value' ])
const raw = new Set(['value'])
const proxy = reactive(raw)
const thisArg = {}
let count = 0
proxy.forEach(function (this :{}, value, _, set) {
proxy.forEach(function(this: {}, value, _, set) {
++count
expect(this).toBe(thisArg)
expect(value).toBe('value')

View File

@@ -49,7 +49,7 @@ function createGetter(isReadonly = false, shallow = false) {
}
const res = Reflect.get(target, key, receiver)
if (isSymbol(key) && builtInSymbols.has(key) || key === '__proto__') {
if ((isSymbol(key) && builtInSymbols.has(key)) || key === '__proto__') {
return res
}