mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:58:11 +00:00
LibJS: Dont try to serialize symbol-keyed properties
As per the specification: "All Symbol-keyed properties will be completely ignored, even when using the replacer function."
This commit is contained in:
parent
fff7aceb9d
commit
223472c57f
2 changed files with 9 additions and 0 deletions
|
@ -43,6 +43,13 @@ describe("correct behavior", () => {
|
|||
Object.defineProperty(o, "baz", { value: "qux", enumerable: false });
|
||||
expect(JSON.stringify(o)).toBe('{"foo":"bar"}');
|
||||
});
|
||||
|
||||
test("ignores symbol properties", () => {
|
||||
let o = { foo: "bar" };
|
||||
let sym = Symbol("baz");
|
||||
o[sym] = "qux";
|
||||
expect(JSON.stringify(o)).toBe('{"foo":"bar"}');
|
||||
});
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue