Fix S*RAM, Sim.setVolume

This commit is contained in:
2024-11-01 18:29:13 -05:00
parent 26a0357afa
commit 8b9152dde9
3 changed files with 7 additions and 4 deletions
+4 -2
View File
@@ -495,8 +495,10 @@ class Sim extends HTMLElement {
async setVolume(volume) {
// Error checking
if (!Number.isFinite(volume) ||volume < 0 || volume > 1)
throw new RangeError("Volume must be a number from 0 to 1.");
if (!Number.isFinite(volume) ||volume < 0 || volume > 10) {
throw new RangeError(
"Volume must be a number from 0\u00d7 to 10\u00d7.");
}
// Configure instance fields
this.#volume = volume;