<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:#000000">f.e.</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:#000000">```js</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:#000000">let resolve</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:#000000">let p = new Promise(r => resolve = r)</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:#000000">resolve(5) // ┬áresolves the promise.</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:#000000">resolve(4) // noop (in Chrome), but why not throw an error?</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:#000000">```</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:#000000">I only tested in Chrome, and I'm assuming it follows spec, but I could be wrong.</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:#000000">I'm asking because it seems that throwing an error will prevent shots in the foot, so that code doesn't assume that resolving on an already resolved Promise worked, although it didn't. It seems like it can lead to unexpected failures.</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:#000000"><br></div><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b style="font-size:12.8px">/#<i>!</i>/</b><font face="courier new, monospace" style="font-size:12.8px">JoePea</font><br></div></div></div>
</div>