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

https://www.w3.org/Bugs/Public/show_bug.cgi?id=15986

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
here.

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
arg2);

    // 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