Use for-of instead of forEach (#3583)

Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
This commit is contained in:
Aya Morisawa
2018-12-11 20:36:55 +09:00
committed by GitHub
parent 30c53e9ee0
commit 125849673a
84 changed files with 345 additions and 283 deletions

View File

@ -174,7 +174,7 @@ export default Vue.extend({
if (this.reply && this.reply.text != null) {
const ast = parse(this.reply.text);
ast.filter(t => t.type == 'mention').forEach(x => {
for (const x of ast.filter(t => t.type == 'mention')) {
const mention = x.host ? `@${x.username}@${toASCII(x.host)}` : `@${x.username}`;
// 自分は除外
@ -185,7 +185,7 @@ export default Vue.extend({
if (this.text.indexOf(`${mention} `) != -1) return;
this.text += `${mention} `;
});
}
}
// デフォルト公開範囲
@ -241,7 +241,7 @@ export default Vue.extend({
this.$chooseDriveFile({
multiple: true
}).then(files => {
files.forEach(this.attachMedia);
for (const x of files) this.attachMedia(x);
});
},
@ -256,7 +256,7 @@ export default Vue.extend({
},
onChangeFile() {
Array.from((this.$refs.file as any).files).forEach(this.upload);
for (const x of Array.from((this.$refs.file as any).files)) this.upload(x);
},
onPollUpdate() {