<br><br><div class="gmail_quote">On Mon, Mar 9, 2009 at 10:23 AM, Jonas Sicking <span dir="ltr"><jonas@sicking.cc></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">
<br>
</div>The problem is that people are likely to write code like:<br>
<br>
if (self.getAllCookies() != "magic value") {<br>
  a = self.getAllCookies();<br>
  ...do stuff...<br>
}<br>
<br>
at that point it's entirely possible for 'a' to have the value "magic<br>
value" which is likely to cause the script to break.</blockquote><div class="im"><br>Here we are making assumptions about how people will use routines that don't actually exist yet. If you were to substitute "new Date().getTime()" for "self.getAllCookies()" in the code above, I think we'd all agree that the user expectation is faulty - is it not feasible to state that, just like Date().getTime(),. getAllCookies() returns a snapshot of a mutable value?<br>
<br>I'm OK with making setCookie() asynchronous, because I think there may be a valid point that you don't want new worker code to suddenly break existing JS code that expects document.cookies to remain immutable across a single block of execution. But I don't see that argument extending to getAllCookies().<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
<br>
</div>Indeed. It does seem like you would be able to ask ;)<br>
<font color="#888888"></font></blockquote><div><br>I'm looking into this now, actually :) - I'll let you know what I find out.<br><br>-atw <br></div></div><br>