This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 18424 - Cannot parse static operation with ReturnType (WebIDL editors draft 10 July 2012)
Summary: Cannot parse static operation with ReturnType (WebIDL editors draft 10 July 2...
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: PC Windows 3.1
: P2 normal
Target Milestone: ---
Assignee: Cameron McCormack
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
: 19777 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-07-27 12:12 UTC by Takashi Sakamoto
Modified: 2012-12-10 05:33 UTC (History)
3 users (show)

See Also:


Attachments

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.