keyman
keyman copied to clipboard
bug(developer): compiler generates invalid javascript for unquoted numbers in `if()` statements
Describe the bug
if(option_key_t_is_tyun = 1) U+221A + [NCAPS K_T] > set(option_key_t_is_tyun = '0') save(option_key_t_is_tyun)
This generates invalid javascript: it generates a store with a value of "\x1"
, which must be "\x01"
to work.
The source keyboard: armenian_mnemonic from https://community.software.sil.org/t/text-suggestion-not-working-in-some-cases/6490/4 (armenian_mnemonic.zip)
Proposed mitigations:
- always generate minimum 2 char hexadecimal sequences.
- possibly, hint that an unquoted number might not be expected?
- not really related, but compress the list of compared store values so we don't end up with hundreds of them in the compiled keyboard.
Keyman Developer:
- OS: any
- Keyman Developer version: 15.0.267