mirror of https://github.com/vuejs/core.git
fix(build): fix const enum w/ number values
This commit is contained in:
parent
097f6beca2
commit
92bb189ca7
|
@ -149,10 +149,9 @@ export function scanEnums() {
|
||||||
} else {
|
} else {
|
||||||
if (lastInitialized === undefined) {
|
if (lastInitialized === undefined) {
|
||||||
// first initialized
|
// first initialized
|
||||||
saveValue(`0`)
|
saveValue((lastInitialized = 0))
|
||||||
lastInitialized = 0
|
|
||||||
} else if (typeof lastInitialized === 'number') {
|
} else if (typeof lastInitialized === 'number') {
|
||||||
saveValue(String(++lastInitialized))
|
saveValue(++lastInitialized)
|
||||||
} else {
|
} else {
|
||||||
// should not happen
|
// should not happen
|
||||||
throw new Error(`wrong enum initialization sequence in ${file}`)
|
throw new Error(`wrong enum initialization sequence in ${file}`)
|
||||||
|
|
Loading…
Reference in New Issue