Re: [heycam/webidl] Arguments allow double extended attributes (#691)

I'm not sure I understand what the problem is.

    void foo([ExtAttr] optional [Clamp] short argname);
    void bar([ExtAttr, Clamp] short argname);

In the former case (`foo`), everything is clear: `[ExtAttr]` applies to the argument as a whole, while `[Clamp]` applies to the type.

In the latter case (`bar`) things are a bit more complicated because there is only one space to put extended attributes.  Both `[ExtAttr]` and `[Clamp]` are initially applied to the argument as a whole, but then `[Clamp]` is propagated through to the type by https://heycam.github.io/webidl/#idl-type-extended-attribute-associated-with step 4.  So the end result is that `[Clamp]` applies to the type and both extended attrs apply to the argument itself.  Since the argument itself does nothing with its extended attributes for the moment, that's fine.  If that were to change, whatever it does would need to ignore the extended attributes matching https://heycam.github.io/webidl/#extended-attributes-applicable-to-types

The fact that you can have extended attributes on the argument itself is intentional; while Web IDL itself does not currently define any such extended attributes, consumers of Web IDL might.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/691#issuecomment-474450718

Received on Tuesday, 19 March 2019 16:14:44 UTC