From 9eda7eeaf6c8b4bc0810f28da32c7bcbf43f4c5b Mon Sep 17 00:00:00 2001 From: "Florine W. Dekker" Date: Wed, 14 Dec 2022 11:25:10 +0100 Subject: [PATCH] Remove exception on invalid input --- package-lock.json | Bin 214000 -> 214000 bytes package.json | 4 ++-- src/main/js/Main.ts | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index e232c46655bff7bbcc2b199974787ad1317f7147..f951c0ebce70de97f64a571f1a1ceed2be09d094 100644 GIT binary patch delta 272 zcmey+&ikRAcY+?H@kIUp$yIv4K^1_We glRxa2Y=5(UOiaymv39!RKSrbFA5@s-0T;br+W-In diff --git a/package.json b/package.json index 3c18967..0ea8959 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "doomsday", - "version": "1.5.2", + "version": "1.5.3", "description": "Test your mastery of Conway's Doomsday rule.", "author": "Florine W. Dekker", "browser": "dist/bundle.js", @@ -29,7 +29,7 @@ "grunt-text-replace": "^0.4.0", "grunt-webpack": "^5.0.0", "ts-loader": "^9.4.2", - "typescript": "^4.9.3", + "typescript": "^4.9.4", "webpack": "^5.75.0", "webpack-cli": "^5.0.1" } diff --git a/src/main/js/Main.ts b/src/main/js/Main.ts index 655e708..20a55ba 100644 --- a/src/main/js/Main.ts +++ b/src/main/js/Main.ts @@ -75,31 +75,31 @@ class ValidatableInput { /** * Returns `true` if and only if the input is valid. * - * This method **must** be implemented by subclasses. + * Returns `false` by default. Implement this method to make it do something else. * * @param value the value of the input to validate * @return `true` if and only if the input is valid */ isValid(value: string): boolean { - throw new Error("Implement this method."); + return false; } /** * Runs when the user submits a valid input. * - * This method **must** be implemented by subclasses. + * Does nothing by default. Implement this method to make it do something. */ onValidInput(): void { - throw new Error("Implement this method."); + // Do nothing } /** * Runs when a user submits an invalid input. * - * This method **must** be implemented by subclasses. + * Does nothing by default. Implement this method to make it do something. */ onInvalidInput(): void { - throw new Error("Implement this method."); + // Do nothing }