fix(build): fix const enum w/ number values

This commit is contained in:
Evan You 2023-02-06 14:03:15 +08:00
parent 097f6beca2
commit 92bb189ca7
1 changed files with 2 additions and 3 deletions

View File

@ -149,10 +149,9 @@ export function scanEnums() {
} else {
if (lastInitialized === undefined) {
// first initialized
saveValue(`0`)
lastInitialized = 0
saveValue((lastInitialized = 0))
} else if (typeof lastInitialized === 'number') {
saveValue(String(++lastInitialized))
saveValue(++lastInitialized)
} else {
// should not happen
throw new Error(`wrong enum initialization sequence in ${file}`)