Просмотр исходного кода

types: remove 'this' annotation from 'get' accessor (#801)

The next version of Typescript disallows 'this' parameter annotations on
accessors, which causes vue-next to fail to compile.

This PR removes the annotation and adds a cast instead.

Fixes #800
Evan You 6 лет назад
Родитель
Сommit
16f9e63951
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/reactivity/src/collectionHandlers.ts

+ 2 - 2
packages/reactivity/src/collectionHandlers.ts

@@ -176,8 +176,8 @@ const mutableInstrumentations: Record<string, Function> = {
   get(this: MapTypes, key: unknown) {
     return get(this, key, toReactive)
   },
-  get size(this: IterableCollections) {
-    return size(this)
+  get size() {
+    return size(this as unknown as IterableCollections)
   },
   has,
   add,