Currently we allows anything including numbers and strings for extended attribute rhs:
|
// Conformance with ExtendedAttributeList grammar in http://www.w3.org/TR/WebIDL/#idl-extended-attributes |
|
// Section 3.11 |
|
[IntAttr=0, FloatAttr=3.14, StringAttr="abc"] |
|
interface IdInterface {}; |
... but the spec says:
The ExtendedAttribute grammar symbol matches nearly any sequence of tokens, however the extended attributes defined in this document only accept a more restricted syntax. Any extended attribute encountered in an IDL fragment is matched against the following five grammar symbols to determine which form (or forms) it is in:
| Grammar symbol |
Form |
Example |
| ExtendedAttributeNoArgs |
takes no arguments |
[Replaceable] |
| ExtendedAttributeArgList |
takes an argument list |
[Constructor(double x, double y)] |
| ExtendedAttributeNamedArgList |
takes a named argument list |
[NamedConstructor=Image(DOMString >src)] |
| ExtendedAttributeIdent |
takes an identifier |
[PutForwards=name] |
| ExtendedAttributeIdentList |
takes an identifier list |
[Exposed=(Window,Worker)] |
rhs should only allow 1) a named argument list 2) an identifier or 3) an identifier list.
Related to https://github.com/w3c/respec/issues/1760
Currently we allows anything including numbers and strings for extended attribute rhs:
webidl2.js/test/syntax/idl/extended-attributes.widl
Lines 8 to 11 in 0c103b3
... but the spec says:
rhs should only allow 1) a named argument list 2) an identifier or 3) an identifier list.
Related to https://github.com/w3c/respec/issues/1760