2
0
Эх сурвалжийг харах

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 жил өмнө
parent
commit
16f9e63951

+ 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,