On Oct 20, 2011, at 12:59 PM, Jorge wrote:
>>> assert_invariants();
>>> f(); //might suspend execution
>>> assert_invariants(); // perhaps yes, perhaps no. There's no guarantee
>>> either.
>>> return;
(Please trim cited text -- I know gmail hides it, which is a bug, but most mail
user agents show it, and think of the bandwidth!)
> I don't see how it's different: next to f() it says //might suspend execution:
You wrote that comment, not me.
I wrote
assert_invariants();
f();
assert_invariants_not_affected_by_f_etc();
and this is how JS works today. This is "run-to-completion". It's important not
to break it.
> the assert_invariants() at the next line might run in another turn of the
> event loop (when f() resumes), just as the callback does.
No. Nothing in JS today, since it lacks coroutines or call/cc, can suspend
under f and cause the continuation to be captured and then called in a later
event loop turn.
That's the point.
/be
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss