← Back to release summary

JSON.parse source text access

Category
JavaScript
Type
Chromium catches up
Status
In developer trial (Behind a flag) (Chrome 114)
Intent stage
Prepare to ship

Summary

This proposal adds an object with a "source" property that is passed as the 3rd argument to the reviver function in JSON.parse. This property contains the raw source text for the value being parsed. It is designed to address the issue that JSON parsing is lossy, e.g. around BigInt values. For example, `JSON.parse(" 9999999999999999", (key, val, {source}) => BigInt(source))`.

Standards & signals

Explainers: https://github.com/tc39/proposal-json-parse-with-source/blob/master/README.md

View on chromestatus.com