Intent to Ship: JSON.parse source text access

142 views
Skip to first unread message

Shu-yu Guo

unread,
Mar 27, 2023, 8:27:17 PM3/27/23
to blink-dev

Contact emails

s...@chromium.org

Explainer

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

Specification

https://tc39.es/proposal-json-parse-with-source

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))`.



Blink component

Blink>JavaScript>Language

TAG review



TAG review status

Not applicable

Risks



Interoperability and Compatibility



Gecko: Positive This is a Stage 3 TC39 proposal.

WebKit: Positive This is a Stage 3 TC39 proposal.

Web developers: No signals

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?



Debuggability

The 3rd argument being added will be debugged as any JavaScript function argument.



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

In test262: https://github.com/tc39/test262/pull/3806

Flag name

--harmony-json-parse-with-source

Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/v8/issues/detail?id=12955

Estimated milestones

Shipping on desktop114
DevTrial on desktop108
DevTrial on Android108


Anticipated spec changes

None



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5121582673428480

This intent message was generated by Chrome Platform Status.

Yoav Weiss

unread,
Mar 28, 2023, 9:13:34 AM3/28/23
to Shu-yu Guo, blink-dev
LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAN-e9e_i9snn_eZQ_eZgL-_%3DzTvBQZ1E4h_kxhVfKVSL892gCQ%40mail.gmail.com.

Mike Taylor

unread,
Mar 28, 2023, 9:25:03 AM3/28/23
to Yoav Weiss, Shu-yu Guo, blink-dev

Daniel Bratell

unread,
Mar 29, 2023, 11:30:00 AM3/29/23
to Mike Taylor, Yoav Weiss, Shu-yu Guo, blink-dev
Reply all
Reply to author
Forward
0 new messages