Skip to content

Symbol descriptions don't work #43

@lonevox

Description

@lonevox

Minecraft Version

1.20.1

KubeJS Version

2001.6.4-build.130

Rhino Version

2001.2.2-build.18

Architectury Version

9.1.12

Forge/Fabric Version

Forge 47.2.17

Describe your issue

Take the following code from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/description:

console.warn(Symbol('desc').description)
// Expected output: "desc"
console.warn(Symbol.iterator.description)
// Expected output: "Symbol.iterator"
console.warn(Symbol.for('foo').description)
// Expected output: "foo"
console.warn(`${Symbol('foo').description}bar`)
// Expected output: "foobar"

console.warn(Symbol.keyFor(Symbol.for('foo')))
// Expected output: "foo"

In a script, this gives the following output:
image
Only console.warn(Symbol.keyFor(Symbol.for('foo'))) has the expected output.

It's worth noting that the symbols do exist and can be printed:

console.warn(Symbol('desc'))
console.warn(Symbol.iterator)
console.warn(Symbol.for('foo'))

The above code gives:
image

Crash report/logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions