fix #8821 JS codegen can produce extreme switch statements with case … (#20548)

* fix #8821 JS codegen can produce extreme switch statements with case a of range

* remove totalRange
This commit is contained in:
Bung 2022-10-14 18:21:02 +08:00 • committed by GitHub
commit b286448a99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 10 deletions

View file

@ -1,6 +1,3 @@
discard """
errormsg: "Your case statement contains too many branches, consider using if/else instead!"
"""
proc isInt32(i: int): bool =
case i
@ -9,4 +6,4 @@ proc isInt32(i: int): bool =
else:
return false
discard isInt32(1)
doAssert isInt32(1) == true