From 47e315f94a17be1298e11c6e5072864ceb8c4411 Mon Sep 17 00:00:00 2001 From: Leonabcd123 <156839416+Leonabcd123@users.noreply.github.com> Date: Wed, 11 Feb 2026 21:20:22 +0200 Subject: [PATCH 1/8] Practise words doesn't work with __proto__ --- frontend/src/ts/test/test-input.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/ts/test/test-input.ts b/frontend/src/ts/test/test-input.ts index 27910a80cdcc..37d1e1d82d96 100644 --- a/frontend/src/ts/test/test-input.ts +++ b/frontend/src/ts/test/test-input.ts @@ -212,7 +212,10 @@ export const corrected = new Corrected(); export let keypressCountHistory: number[] = []; let currentKeypressCount = 0; export let currentBurstStart = 0; -export let missedWords: Record = {}; +type missedWordsType = Record; +export let missedWords: missedWordsType = Object.create( + null, +) as missedWordsType; export let accuracy = { correct: 0, incorrect: 0, @@ -542,7 +545,7 @@ export function restart(): void { words: [], }; currentBurstStart = 0; - missedWords = {}; + missedWords = Object.create(null) as missedWordsType; accuracy = { correct: 0, incorrect: 0, From 8c7739a2a38114748eac160a8f1f775f5e1aabc1 Mon Sep 17 00:00:00 2001 From: Leonabcd123 <156839416+Leonabcd123@users.noreply.github.com> Date: Sat, 28 Feb 2026 16:16:46 +0200 Subject: [PATCH 2/8] Capitalize --- frontend/src/ts/test/test-input.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/ts/test/test-input.ts b/frontend/src/ts/test/test-input.ts index 37d1e1d82d96..0637b4061756 100644 --- a/frontend/src/ts/test/test-input.ts +++ b/frontend/src/ts/test/test-input.ts @@ -212,10 +212,10 @@ export const corrected = new Corrected(); export let keypressCountHistory: number[] = []; let currentKeypressCount = 0; export let currentBurstStart = 0; -type missedWordsType = Record; -export let missedWords: missedWordsType = Object.create( +type MissedWordsType = Record; +export let missedWords: MissedWordsType = Object.create( null, -) as missedWordsType; +) as MissedWordsType; export let accuracy = { correct: 0, incorrect: 0, @@ -545,7 +545,7 @@ export function restart(): void { words: [], }; currentBurstStart = 0; - missedWords = Object.create(null) as missedWordsType; + missedWords = Object.create(null) as MissedWordsType; accuracy = { correct: 0, incorrect: 0, From 9c6e0847373ee0046573ade237b86f4874400a01 Mon Sep 17 00:00:00 2001 From: Leonabcd123 <156839416+Leonabcd123@users.noreply.github.com> Date: Sat, 28 Feb 2026 17:26:15 +0200 Subject: [PATCH 3/8] Add comment --- frontend/src/ts/test/test-input.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/ts/test/test-input.ts b/frontend/src/ts/test/test-input.ts index 0637b4061756..a71e455694e4 100644 --- a/frontend/src/ts/test/test-input.ts +++ b/frontend/src/ts/test/test-input.ts @@ -213,6 +213,7 @@ export let keypressCountHistory: number[] = []; let currentKeypressCount = 0; export let currentBurstStart = 0; type MissedWordsType = Record; +// We're using Object.create(null) to make sure that __proto__ won't have any special meaning (so if a user mistypes the word __proto__ it will appear correctly in the practise words test export let missedWords: MissedWordsType = Object.create( null, ) as MissedWordsType; From 44e2990cc8f37a796f66c50959020ad67edf6f71 Mon Sep 17 00:00:00 2001 From: Leonabcd123 <156839416+Leonabcd123@users.noreply.github.com> Date: Sat, 28 Feb 2026 18:12:48 +0200 Subject: [PATCH 4/8] Improve comment --- frontend/src/ts/test/test-input.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/ts/test/test-input.ts b/frontend/src/ts/test/test-input.ts index a71e455694e4..51d274719ca0 100644 --- a/frontend/src/ts/test/test-input.ts +++ b/frontend/src/ts/test/test-input.ts @@ -213,7 +213,7 @@ export let keypressCountHistory: number[] = []; let currentKeypressCount = 0; export let currentBurstStart = 0; type MissedWordsType = Record; -// We're using Object.create(null) to make sure that __proto__ won't have any special meaning (so if a user mistypes the word __proto__ it will appear correctly in the practise words test +// We're using Object.create(null) to make sure that __proto__ won't have any special meaning when it's used to index the missedWords object (so if a user mistypes the word __proto__ it will appear correctly in the practise words test export let missedWords: MissedWordsType = Object.create( null, ) as MissedWordsType; From dd344006b53f966213faffa12dd11b21b2eb0708 Mon Sep 17 00:00:00 2001 From: Leonabcd123 <156839416+Leonabcd123@users.noreply.github.com> Date: Sat, 28 Feb 2026 18:13:35 +0200 Subject: [PATCH 5/8] The --- frontend/src/ts/test/test-input.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/ts/test/test-input.ts b/frontend/src/ts/test/test-input.ts index 51d274719ca0..149a786d77ab 100644 --- a/frontend/src/ts/test/test-input.ts +++ b/frontend/src/ts/test/test-input.ts @@ -213,7 +213,7 @@ export let keypressCountHistory: number[] = []; let currentKeypressCount = 0; export let currentBurstStart = 0; type MissedWordsType = Record; -// We're using Object.create(null) to make sure that __proto__ won't have any special meaning when it's used to index the missedWords object (so if a user mistypes the word __proto__ it will appear correctly in the practise words test +// We're using Object.create(null) to make sure that __proto__ won't have any special meaning when it's used to index the missedWords object (so if the user mistypes the word __proto__ it will appear correctly in the practise words test export let missedWords: MissedWordsType = Object.create( null, ) as MissedWordsType; From 32db1641498a11e670001f535c8d9c57e52e21e8 Mon Sep 17 00:00:00 2001 From: Leonabcd123 <156839416+Leonabcd123@users.noreply.github.com> Date: Sat, 28 Feb 2026 18:14:03 +0200 Subject: [PATCH 6/8] Revert "The" This reverts commit dd344006b53f966213faffa12dd11b21b2eb0708. --- frontend/src/ts/test/test-input.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/ts/test/test-input.ts b/frontend/src/ts/test/test-input.ts index 149a786d77ab..51d274719ca0 100644 --- a/frontend/src/ts/test/test-input.ts +++ b/frontend/src/ts/test/test-input.ts @@ -213,7 +213,7 @@ export let keypressCountHistory: number[] = []; let currentKeypressCount = 0; export let currentBurstStart = 0; type MissedWordsType = Record; -// We're using Object.create(null) to make sure that __proto__ won't have any special meaning when it's used to index the missedWords object (so if the user mistypes the word __proto__ it will appear correctly in the practise words test +// We're using Object.create(null) to make sure that __proto__ won't have any special meaning when it's used to index the missedWords object (so if a user mistypes the word __proto__ it will appear correctly in the practise words test export let missedWords: MissedWordsType = Object.create( null, ) as MissedWordsType; From 83052d211353b1b8edab77b5c9c7873f46499293 Mon Sep 17 00:00:00 2001 From: Leonabcd123 <156839416+Leonabcd123@users.noreply.github.com> Date: Sat, 28 Feb 2026 18:14:59 +0200 Subject: [PATCH 7/8] Close parenthesis --- frontend/src/ts/test/test-input.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/ts/test/test-input.ts b/frontend/src/ts/test/test-input.ts index 51d274719ca0..0d20e113f629 100644 --- a/frontend/src/ts/test/test-input.ts +++ b/frontend/src/ts/test/test-input.ts @@ -213,7 +213,7 @@ export let keypressCountHistory: number[] = []; let currentKeypressCount = 0; export let currentBurstStart = 0; type MissedWordsType = Record; -// We're using Object.create(null) to make sure that __proto__ won't have any special meaning when it's used to index the missedWords object (so if a user mistypes the word __proto__ it will appear correctly in the practise words test +// We're using Object.create(null) to make sure that __proto__ won't have any special meaning when it's used to index the missedWords object (so if a user mistypes the word __proto__ it will appear correctly in the practise words test) export let missedWords: MissedWordsType = Object.create( null, ) as MissedWordsType; From 3d3cba306bfb5ac7440b3a7acba9aae0e6950f05 Mon Sep 17 00:00:00 2001 From: Leonabcd123 <156839416+Leonabcd123@users.noreply.github.com> Date: Sat, 28 Feb 2026 18:15:30 +0200 Subject: [PATCH 8/8] Remove correctly --- frontend/src/ts/test/test-input.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/ts/test/test-input.ts b/frontend/src/ts/test/test-input.ts index 0d20e113f629..b62359165529 100644 --- a/frontend/src/ts/test/test-input.ts +++ b/frontend/src/ts/test/test-input.ts @@ -213,7 +213,7 @@ export let keypressCountHistory: number[] = []; let currentKeypressCount = 0; export let currentBurstStart = 0; type MissedWordsType = Record; -// We're using Object.create(null) to make sure that __proto__ won't have any special meaning when it's used to index the missedWords object (so if a user mistypes the word __proto__ it will appear correctly in the practise words test) +// We're using Object.create(null) to make sure that __proto__ won't have any special meaning when it's used to index the missedWords object (so if a user mistypes the word __proto__ it will appear in the practise words test) export let missedWords: MissedWordsType = Object.create( null, ) as MissedWordsType;