- From: Jonas Sicking <jonas@sicking.cc>
- Date: Wed, 19 Feb 2014 14:21:50 -0800
- To: Domenic Denicola <domenic@domenicdenicola.com>
- Cc: Boris Zbarsky <bzbarsky@mit.edu>, "public-script-coord@w3.org" <public-script-coord@w3.org>, "Mark S. Miller" <erights@google.com>
On Wed, Feb 19, 2014 at 1:36 PM, Domenic Denicola <domenic@domenicdenicola.com> wrote: > > From: Jonas Sicking <jonas@sicking.cc> > >>I can both see the argument "if you were to naively implement this in JS omitting x should be equivalent to x === undefined" and "omitting x is clearly a bug, throw an exception". > > I'm trying to understand the specific use case here. Why would passing `undefined` not be "clearly a bug"? Is it because `undefined` is a valid message to post? Yes. > In that case, if I were a JS programmer trying to post a message of `undefined`, I would do so by doing `postMessage()`, not `postMessage(undefined)`. That seems exceedingly awkward. Consider function processWork(data) { if (data === undefined) { worker.postMessage(); } else { worker.postMessage(data); } } vs. function processWork(data) { worker.postMessage(data); } / Jonas
Received on Wednesday, 19 February 2014 22:22:47 UTC