Skip to content

Commit

Permalink
fix(build): fix const enum w/ number values
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Feb 6, 2023
1 parent 097f6be commit 92bb189
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripts/const-enum.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
Expand Down

0 comments on commit 92bb189

Please sign in to comment.