W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2014

RE: Removing the concept of "optional any"

From: Domenic Denicola <domenic@domenicdenicola.com>
Date: Wed, 19 Feb 2014 21:36:22 +0000
To: Jonas Sicking <jonas@sicking.cc>
CC: Boris Zbarsky <bzbarsky@mit.edu>, "public-script-coord@w3.org" <public-script-coord@w3.org>, "Mark S. Miller" <erights@google.com>
Message-ID: <ed2734171a724abba7c399fe88be509b@BN1PR05MB325.namprd05.prod.outlook.com>

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?

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)`.

Indeed, if I were doing a code review on someone's code that contained `postMessage(undefined)`, I would correct them, saying "there's no need to explicitly pass `undefined`; that's the default for omitted arguments. You should correct that to just `postMessage()`."
Received on Wednesday, 19 February 2014 21:37:12 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:51 UTC