-
Notifications
You must be signed in to change notification settings - Fork 110
Description
What problem are you trying to solve?
Parse a JSON string to an Infra value and parse JSON bytes to an Infra value convert Infra types to Infra types, but because they use %JSON.parse% internally, they implicitly expect there to be a current realm, which means they strictly can't be called from in parallel.
Actual implementations can parse JSON to an internal representation without using the JS engine, so specs should be able to also.
What solutions exist today?
It's often possible to parse the JSON before going into parallel, or to bounce through the main thread if the JSON arrived from a parallel fetch, but these can complicate the spec algorithms.
How would you solve it?
The simplest way might be to say that even though these algorithms are specified as if they used a JS realm, we assert that they're usable without a current realm. This leaves the exact details a bit imprecisely specified, but the bits that lose their detailed meaning inside the JS spec don't actually matter to the result of the algorithm.
The other solution would be to respecify JSON parsing purely in terms of Infra concepts, which is going to be an uncomfortably big patch.
Anything else?
No response