From: 扩散性百万甜面包 Date: Sat, 5 Oct 2019 14:44:02 +0000 (+0800) Subject: chore: simplify code in apiWatch.ts (#101) X-Git-Tag: v3.0.0-alpha.0~597 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ec8f7c6375c646f700fb18c1e405973e9b0ed368;p=thirdparty%2Fvuejs%2Fcore.git chore: simplify code in apiWatch.ts (#101) --- diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index f5d5e14488..139767c656 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -231,12 +231,12 @@ function traverse(value: any, seen: Set = new Set()) { traverse(value[i], seen) } } else if (value instanceof Map) { - ;(value as any).forEach((v: any, key: any) => { + value.forEach((v, key) => { // to register mutation dep for existing keys traverse(value.get(key), seen) }) } else if (value instanceof Set) { - ;(value as any).forEach((v: any) => { + value.forEach(v => { traverse(v, seen) }) } else {