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

[Bug 15986] Specify exactly how and when ECMAScript arguments are evaluated

From: <bugzilla@jessica.w3.org>
Date: Mon, 20 Feb 2012 03:49:49 +0000
To: public-script-coord@w3.org
Message-Id: <E1RzKG5-0001ge-TM@jessica.w3.org>

Cameron McCormack <cam@mcc.id.au> changed:

           What    |Removed                     |Added
                 CC|                            |ian@hixie.ch

--- Comment #15 from Cameron McCormack <cam@mcc.id.au> 2012-02-20 03:49:49 UTC ---
(In reply to comment #14)
> However, some of them could be more specific, for example the arguments for
> DataTransferItenList.add might be expressed as:
> ((DOMString or File) data, optional DOMString type)
> with the prose specification saying that the second argument is only legal when
> the first argument is a DOMString.

Yes, I think we should encourage spec writers to be as specific as possible

The specific changes we would make then are:

  interface BlobBuilder {
    void append(in (Blob or ArrayBuffer or DOMString) data,
                in optional DOMString endings);

    // Prose for append says to throw a TypeError if endings is
    // specified when data is not a DOMString.

  interface CanvasRenderingContext2D {
    ImageData createImageData((ImageData or double) arg1, optional double

    // Looks strange, and obscures the two valid invocations of the operation.
    // Prose for createImageData says to throw a TypeError if arg2 is specified
    // and arg1 is not a double.  The alternative would be:
    //   ImageData createImageData(any... args);
    // and write more prose to say how to convert non-Number non-ImageData
    // values that were passed as the first argument, and how to convert
    // non-Number values passed as the second argument.

  interface DataTransferItemList {
    DataTransferItem? add((File or DOMString) data, optional DOMString type);

    // Prose for add says to throw a TypeError if type is specified
    // when data is not a DOMString.

CCing Ian for his take on the latter two, since they're in his spec.

Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Received on Monday, 20 February 2012 03:49:51 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:05 UTC