- From: Jonas Sicking <jonas@sicking.cc>
- Date: Mon, 9 Mar 2009 11:32:06 -0700
On Mon, Mar 9, 2009 at 11:26 AM, Giovanni Campagna <scampa.giovanni at gmail.com> wrote: > 2009/3/9 Jonas Sicking <jonas at sicking.cc>: >> On Mon, Mar 9, 2009 at 11:01 AM, Giovanni Campagna >>> This can be even worse: how would you syncronize the code in the >>> callback with code right after the call? You don't have any of >>> semaphores or mutexes in ES and I don't expect them to be added soon. >> >> I'm not sure I understand the problem you are describing. Could you >> show an example using the APIs that exist in the spec today and with >> an async cookie API added? > > var x = 7; > function callback(cookies) { > x = 5; > } > getAllCookies(callback); > alert(x == 7); True. The callback can't happen in the middle of executing code. Javascript uses a run-to-completion model. / Jonas
Received on Monday, 9 March 2009 11:32:06 UTC