]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types(reactivity): remove this in get accessor, fix #800 (#806)
authordjy0 <krivergo3@gmail.com>
Mon, 9 Mar 2020 20:01:49 +0000 (04:01 +0800)
committerGitHub <noreply@github.com>
Mon, 9 Mar 2020 20:01:49 +0000 (16:01 -0400)
packages/reactivity/src/baseHandlers.ts
packages/reactivity/src/collectionHandlers.ts

index 932f4ebec0d6de10beeab83f63e468b0febd38df..4d5ec50f7395a9789a5976233fc54bd7297b8aec 100644 (file)
@@ -23,7 +23,7 @@ const arrayInstrumentations: Record<string, Function> = {}
     for (let i = 0, l = (this as any).length; i < l; i++) {
       track(arr, TrackOpTypes.GET, i + '')
     }
-    // we run the method using the orignal args first (which may be reactive)
+    // we run the method using the original args first (which may be reactive)
     const res = arr[key](...args)
     if (res === -1 || res === false) {
       // if that didn't work, run it again using raw values.
index e173ce302d94ca31b69cc910ca15367f0bd74d07..07ad0144ad0fb4f6e1beb980833da13f11e07587 100644 (file)
@@ -200,8 +200,8 @@ const readonlyInstrumentations: Record<string, Function> = {
   get(this: MapTypes, key: unknown) {
     return get(this, key, toReadonly)
   },
-  get size(this: IterableCollections) {
-    return size(this)
+  get size() {
+    return size((this as unknown) as IterableCollections)
   },
   has,
   add: createReadonlyMethod(add, TriggerOpTypes.ADD),