async-json
async-json copied to clipboard
Thread safety when JSON.stringifyAsync
Mostly from https://github.com/nodejs/io.js/issues/2031#issuecomment-114347314
Consider following code:
let obj = {foo: 1};
JSON.stringifyAsync(obj, result => console.log(result));
delete obj.foo
There could be a thread collision issue here. What can be done?
JS is single-threaded. While an implementation may choose to implement it in that way, they'd have to ensure that observable semantics didn't conflict with that. Thus, any mention of threading in the spec is unlikely to pass muster.