;(value as any).__proto__ = arrayMethods Question point

This issue has been tracked since 2022-08-29.

What problem does this feature solve?

Looking at Observer today, I found a question

if (hasProto) {
/* eslint-disable no-proto /
;(value as any).proto = arrayMethods
/
eslint-enable no-proto */
} else {
for (let i = 0, l = arrayKeys.length; i < l; i++) {
const key = arrayKeys[i]
def(value, key, arrayMethods[key])
}
}
这里的;(value as any).proto = arrayMethods前面的“;”有什么特殊含义?

What does the proposed API look like?

if (hasProto) {
/* eslint-disable no-proto /
;(value as any).proto = arrayMethods
/
eslint-enable no-proto */
} else {
for (let i = 0, l = arrayKeys.length; i < l; i++) {
const key = arrayKeys[i]
def(value, key, arrayMethods[key])
}
}
这里的;(value as any).proto = arrayMethods前面的“;”有什么特殊含义?

sodatea wrote this answer on 2022-09-01

感谢关注,但是我们的 GitHub issues 只用于 Bug 反馈和特性请求,如果有使用上的问题建议到官方论坛DiscordStackOverflow 或其他问答网站上提问。

sodatea wrote this answer on 2022-09-01

无分号风格的写法会要求当 (, [, ` 出现在行首时必须在前面加一个 ;
参见:https://standardjs.com/rules-zhcn.html#%E5%85%B3%E4%BA%8E%E5%88%86%E5%8F%B7

xiaoxiaoyuanwang wrote this answer on 2022-09-01

@sodatea 谢谢大佬指点

More Details About Repo
Owner Name vuejs
Repo Name vue
Full Name vuejs/vue
Language TypeScript
Created Date 2013-07-29
Updated Date 2022-10-06
Star Count 199800
Watcher Count 6093
Fork Count 32882
Issue Count 590

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date