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

Re: [WebIDL] Constructor with too many arguments throws TypeError?

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Sat, 14 Jun 2014 22:12:37 -0700
Message-ID: <CABZUbM11mkPBQ1cy-Ry4wbcaR738S7FX35tN-DrefYBmq5k7SQ@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: public-script-coord@w3.org
On 6/14/14, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 6/14/14, 1:49 PM, Dirk Schulze wrote:
>> If I have a constructor that takes 4 arguments. If I pass 5 arguments,
>> will it throw a TypeError exception?
>
> Per current WebIDL spec, no.
>
>> I am asking because the general behavior is not interoperable across
>> browsers today.
>
> I find that a bit surprising.  Which browser throws on _extra_ (as
> opposed to missing) arguments?
>
Chrome:
document.createElement("a", "b", "c").getAttribute("is")

document.createElement("a", "b").getAttribute("is");
-- 
Garrett
@xkit
ChordCycles.com
garretts.github.io
Received on Sunday, 15 June 2014 05:13:04 UTC

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