]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types: remove 'this' annotation from 'get' accessor (#801)
authorEvan You <yyx990803@gmail.com>
Thu, 5 Mar 2020 22:57:52 +0000 (16:57 -0600)
committerGitHub <noreply@github.com>
Thu, 5 Mar 2020 22:57:52 +0000 (16:57 -0600)
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

packages/reactivity/src/collectionHandlers.ts

index af4ca05d17f3d80456a62913a33b9e76e12e326b..095537cc4fd871a6099ea2022cdcc8600502397a 100644 (file)
@@ -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,