Closed Bug 848678 Opened 13 years ago Closed 8 years ago

there should be an async JSON.parse

Categories

(Core :: JavaScript Engine, defect)

22 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: j, Unassigned)

Details

JSON.parse blocks the mainloop, this is bad for parsing large json documents, there should be an async JSON.parse function that takes a callback that gets called with the parsed json object. something along the lines of: JSON.parse(data, function(obj) { do something here});
I would need this as an unprivileged javascript api, bug 832664 could be the basis for this, but has notes like "primarily for chrome-privileged". If bug 832664 is about adding such an api to unprivileged javascript, this bug can be closed as a duplicate.
ECMAScript has no concept of asynchrony at present, so this can't be a JS feature: it has to be a DOM feature. (The underlying implementation would live in JS, of course.) I think you want to present this need on the whatwg mailing list and get something hashed out there for implementation in the browser. http://lists.whatwg.org/listinfo.cgi/whatwg-whatwg.org
Assignee: general → nobody
New features to JavaScript should now be proposed to TC39 [1] before being implemented in SpiderMonkey, therefore closing as INVALID. [1] https://github.com/tc39/proposals/blob/master/CONTRIBUTING.md
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.