Răsfoiți Sursa

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 ani în urmă
părinte
comite
16f9e63951
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  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) {
   get(this: MapTypes, key: unknown) {
     return get(this, key, toReactive)
     return get(this, key, toReactive)
   },
   },
-  get size(this: IterableCollections) {
-    return size(this)
+  get size() {
+    return size(this as unknown as IterableCollections)
   },
   },
   has,
   has,
   add,
   add,