[Developer Console] Object Output Ignores Symbol Properties

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
RealityRipple
Astronaut
Astronaut
Posts: 666
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California

[Developer Console] Object Output Ignores Symbol Properties

Unread post by RealityRipple » 2023-09-15, 21:33

I was messing around with associative array Objects in JS and noticed that if you use a Symbol() as the property name/key, they don't get listed when you spit out the object:

Code: Select all

let test = {};
let s = Symbol();
let t = Symbol();
let v = Symbol('example');
test[s] = 1;
test[t] = 2;
test['u'] = 3;
test[v] = 4;
test['w'] = 5;
console.log(test);
will only spit out "Object { u: 3, w: 5 }" in the console.

Actual functionality, such as "test[t]", "test.hasOwnProperty(v)", "Object.hasOwn(test, s)", etc... all work exactly as expected, so it's not broken at a functionality level, just the console display. Definitely a low-priority problem, but I figured I'd mention it in case anyone doing debugging is looking at an object and wondering where the Symbol()ized properties are.

Edit: I think this may be an actual issue, as Object.getOwnPropertyDescriptors() is not listing symbols either.