Bug 18424 - Cannot parse static operation with ReturnType (WebIDL editors draft 10 July 2012)
Cannot parse static operation with ReturnType (WebIDL editors draft 10 July 2...
Status: RESOLVED FIXED
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL
unspecified
PC Windows 3.1
: P2 normal
: ---
Assigned To: Cameron McCormack
public-webapps-bugzilla
:
: 19777 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-27 12:12 UTC by Takashi Sakamoto
Modified: 2012-12-10 05:33 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Takashi Sakamoto 2012-07-27 12:12:56 UTC
According to the grammar: http://dev.w3.org/2006/webapi/WebIDL/#idl-grammar, we cannot use static operations which have return types. 

 I think, 

[38]	AttributeOrOperationRest	→	AttributeRest 
                                              | OperationRest 
                                              | ";"

should be

[38]	AttributeOrOperationRest	→	AttributeRest 
                                              | ReturnType OperationRest 
                                              | ";"

For example, suppose that we have "static void classMethod();" declared as "interface member".
According to the grammar: http://dev.w3.org/2006/webapi/WebIDL/#idl-grammar,

[10]	InterfaceMember	→	Const 
                                              | AttributeOrOperationOrIterator

the text matches the rule: InterfaceMember -> AttributeOrOperationOrIterator.

[30]	AttributeOrOperationOrIterator	→	Serializer 
                                              | Qualifier AttributeOrOperationRest 
                                              | Attribute 
                                              | OperationOrIterator

the text matches the rule: AttributeOrOperationOrIterator -> Qualifier AttributeOrOperationRest.

[37]	Qualifier	→	"static" 
                                             | "stringifier"

the text matches the rule: Qualifier -> "static".

[38]	AttributeOrOperationRest	→	AttributeRest 
                                              | OperationRest 
                                              | ";"

the text matches the rule: AttributeOrOperationRest -> OperationRest.

[51]	OperationRest	→	OptionalIdentifier "(" ArgumentList ")" ";"

The OptionalIdentifier matches "void", not "classMethod". So as "(" doesn't match "classMethod", "static classMethod();" is rejected.

Best regards,
Takashi Sakamoto
Comment 1 Peter Van der Beken 2012-10-31 08:49:14 UTC
*** Bug 19777 has been marked as a duplicate of this bug. ***
Comment 2 Cameron McCormack 2012-12-10 05:33:04 UTC
Thanks, fixed now.