"Parse JSON to Infra" algorithms shouldn't require a current JS realm #625
Labels
addition/proposal
New features or enhancements
needs implementer interest
Moving the issue forward requires implementers to express interest
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
The text was updated successfully, but these errors were encountered: