<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Will do!<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 29 Jan 2017, at 15:15, Lars Hansen <<a href="mailto:lhansen@mozilla.com" class="">lhansen@mozilla.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">If you encounter a most-current-release browser that requires the transfer form of postmessage, could you follow up here so that I can bug the appropriate person about it?  Thanks.<br class=""><br class=""></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">--lars<br class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sat, Jan 28, 2017 at 2:26 PM, Axel Rauschmayer <span dir="ltr" class=""><<a href="mailto:rauschma@icloud.com" target="_blank" class="">rauschma@icloud.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">Thanks! This worked for me for a toy example (for multiple calls, I’d record whether an exception was thrown during the first try):</div><div class=""><br class=""></div><div class="">```</div><div class=""><div class=""><font face="Courier" class="">try {</font></div><div class=""><font face="Courier" class="">    // Try new API (clone)</font></div><div class=""><font face="Courier" class="">    worker.postMessage({<wbr class="">sharedBuffer});</font></div><div class=""><font face="Courier" class="">} catch (e) {</font></div><div class=""><font face="Courier" class="">    // Fall back to old API (transfer)</font></div><div class=""><font face="Courier" class="">    worker.postMessage({<wbr class="">sharedBuffer}, [sharedBuffer]);</font></div><div class=""><font face="Courier" class="">}</font></div></div><div class="">```</div><div class=""><br class=""></div><div class="">Complete source code: <a href="https://github.com/rauschma/shared-array-buffer-demo/blob/master/main.js" target="_blank" class="">https://github.com/<wbr class="">rauschma/shared-array-buffer-<wbr class="">demo/blob/master/main.js</a></div><div class=""><br class=""></div><div class="">Axel</div><div class=""><div class="h5"><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 25 Jan 2017, at 15:03, Lars Hansen <<a href="mailto:lhansen@mozilla.com" target="_blank" class="">lhansen@mozilla.com</a>> wrote:</div><br class="m_-7380538915667331310Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">You're asking about how postMessage() handles a SharedArrayBuffer, since the spec changed last summer from requiring the buffer to be in the transfer list to forbidding it.  For the time being, Firefox allows the SAB to be in the transfer list but prints a warning in the console; by and by we will throw an error for that (and until then we'll fail any test cases that test for an exception).  This is implemented in Firefox 51, if my testing right now is correct.<br class=""><br class=""></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Since no browser has officially shipped this functionality I think some browser sniffing may be reasonable for early adopters who want to operate in a multi-browser setting.  I would expect that when this functionality is enabled by default in a browser the browser would adhere to the spec.<br class=""><br class=""></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">--lars<br class=""></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Jan 25, 2017 at 10:49 AM, Axel Rauschmayer <span dir="ltr" class=""><<a href="mailto:rauschma@icloud.com" target="_blank" class="">rauschma@icloud.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">AFAICT, all current implementations want you to transfer SABs. What’s the best way to prepare for the future? `try` transferring and clone in the `catch` clause?<br class="">
<br class="">
Thanks!<br class="">
<br class="">
Axel<br class="">
<br class="">
--<br class="">
Dr. Axel Rauschmayer<br class="">
<a href="http://rauschma.de/" rel="noreferrer" target="_blank" class="">rauschma.de</a><br class="">
[Sent from a mobile device, please forgive brevity and typos]<br class="">
______________________________<wbr class="">_________________<br class="">
es-discuss mailing list<br class="">
<a href="mailto:es-discuss@mozilla.org" target="_blank" class="">es-discuss@mozilla.org</a><br class="">
<a href="https://mail.mozilla.org/listinfo/es-discuss" rel="noreferrer" target="_blank" class="">https://mail.mozilla.org/listi<wbr class="">nfo/es-discuss</a><br class="">
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div><span class="HOEnZb"><font color="#888888" class=""><div class="">
<div style="word-wrap:break-word" class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">-- <br class="">Dr. Axel Rauschmayer<br class=""><a href="mailto:axel@rauschma.de" target="_blank" class="">axel@rauschma.de</a><br class=""><a href="http://dr-axel.de/" target="_blank" class="">dr-axel.de</a></div></div>

</div>
<br class=""></font></span></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""><div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">-- <br class="">Dr. Axel Rauschmayer<br class=""><a href="mailto:axel@rauschma.de" class="">axel@rauschma.de</a><br class="">dr-axel.de</div></div>

</div>
<br class=""></div></body></html>