If a JS object contains keys that are numbers or are strings that can be coerced to numbers, the value is not properly associated with that number key.
Reproduction:
const obj = { 0: 50, 1: 25, 2: 18, 3: 7 }
console.log(Object.keys(obj))
console.log(Object.values(obj))
console.log(Object.entries(obj))
Object.keys(obj) logs:
Object.values(obj) logs:
dev.latvian.mods.rhino.UniqueTag@2115b5b6: NOT_FOUND [dev.latvian.mods.rhino.UniqueTag]
dev.latvian.mods.rhino.UniqueTag@2115b5b6: NOT_FOUND [dev.latvian.mods.rhino.UniqueTag]
dev.latvian.mods.rhino.UniqueTag@2115b5b6: NOT_FOUND [dev.latvian.mods.rhino.UniqueTag]
dev.latvian.mods.rhino.UniqueTag@2115b5b6: NOT_FOUND [dev.latvian.mods.rhino.UniqueTag]
Object.entries(obj) logs:
[0, null]
[1, null]
[2, null]
[3, null]
What should happen is that number keys should be properly associated with their values.
Tested on KubeJS for Minecraft 1.20.1.
If a JS object contains keys that are numbers or are strings that can be coerced to numbers, the value is not properly associated with that number key.
Reproduction:
Object.keys(obj)logs:Object.values(obj)logs:Object.entries(obj)logs:What should happen is that number keys should be properly associated with their values.
Tested on KubeJS for Minecraft 1.20.1.