You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
''.getClass or ''['getClass'] throws an exception upon load/reload instead of returning undefined.
I should be able to access any and every key in a JS object without having to worry about java exceptions.
Whenever a key doesn't exist just return undefined, as is JS convention.
Also java('net.minecraft.network.chat.Component') results in a class of type java.lang.Class, but the fuction getName is apparently not defined. (Error loading KubeJS script: Java class "net.minecraft.network.chat.Component" has no public instance field or method named "getName".)
In this case I would expect typeof java('net.minecraft.network.chat.Component').getName === 'undefined', and java('net.minecraft.network.chat.Component').getName() to error in Cannot call Undefined or something like that.
''.getClass
or''['getClass']
throws an exception upon load/reload instead of returningundefined
.I should be able to access any and every key in a JS object without having to worry about java exceptions.
Whenever a key doesn't exist just return undefined, as is JS convention.
Also
java('net.minecraft.network.chat.Component')
results in a class of typejava.lang.Class
, but the fuctiongetName
is apparently not defined. (Error loading KubeJS script: Java class "net.minecraft.network.chat.Component" has no public instance field or method named "getName".
)In this case I would expect
typeof java('net.minecraft.network.chat.Component').getName === 'undefined'
, andjava('net.minecraft.network.chat.Component').getName()
to error inCannot call Undefined
or something like that.Initial discussion on Discord: https://discord.com/channels/303440391124942858/1069124194786361364/1069124194786361364
The text was updated successfully, but these errors were encountered: