KubeJS

KubeJS

61M Downloads

Can't delete entries from js map

juh9870 opened this issue ยท 0 comments

commented

Minecraft Version

1.18.2

KubeJS Version

kubejs-forge-1802.5.4-build.524.jar

Rhino Version

rhino-forge-1802.1.14-build.204.jar

Architectury Version

architectury-4.5.76-forge.jar

Forge/Fabric Version

40.1.67

Describe your issue

Right now it seelm impossible to delete entries fromr egular JS map.
Regular JS syntax is delete obj[key] but it doesn't work in KubeJS

    let obj = {};
    obj["5"] = 5;
    delete obj["5"];

results in syntax error
[11:48:31] [ERR ] Error loading KubeJS script: missing ; before statement (server_scripts:rotation_script.js#15)

and if I try to add round brackets (also a valid JS syntax) I get runtime error

    let obj = {};
    obj["5"] = 5;
    delete(obj["5"]);
[11:50:08] [ERR  ] Error occurred while handling event 'level.tick': ReferenceError: "delete" is not defined. (server_scripts:rotation_script.js#15)

Crash report/logs

No response