Closed Bug 1860185 Opened 1 year ago Closed 1 year ago

Refactor JSON.parse implementation to match current spec

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
121 Branch
Tracking Status
firefox121 --- fixed

People

(Reporter: bthrall, Assigned: bthrall)

References

(Blocks 1 open bug)

Details

Attachments

(6 files)

The JSON.parse implementation reflects the ES5 spec.

To make it easier to make changes in the future, we should refactor the implementation to reflect the current spec.

The code comments should reference the current spec section and headers.
Where possible, without hurting performance, the code structure should also reflect the algorithms in the spec (including variable names, function names, data flow, etc.).

Assignee: nobody → bthrall
Severity: -- → N/A
Status: NEW → ASSIGNED
Priority: -- → P2

Depends on D191775

The code structure already resembled the spec algorithms, with exceptions for performance. I did need to rename a few methods to better mach the spec, but none of the differences in variable names seemed significant enough to need updating.

Pushed by bthrall@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/28ba90bd58a2 Sync JSON.parse spec references to ECMA-262 spec 14th ed. r=jandem https://hg.mozilla.org/integration/autoland/rev/7e2c4ed96bb1 Sync JSON.stringify spec references to ECMA-262 spec 14th ed. r=jandem https://hg.mozilla.org/integration/autoland/rev/a90002692362 Rename InternalizeJSONProperty r=jandem https://hg.mozilla.org/integration/autoland/rev/1f12fb871f48 Rename SerializeJSONObject and SerializeJSONArray r=jandem https://hg.mozilla.org/integration/autoland/rev/3192598920b3 Rename SerializeJSONProperty and FastSerializeJSONProperty r=jandem https://hg.mozilla.org/integration/autoland/rev/897b39f9148a Rename QuoteJSONString, QuoteJSONStringHelper, InfallibleQuoteJSONString r=jandem
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: