Bug 149406

Summary: Fix warnings in IDLParser.pm
Product: WebKit Reporter: Csaba Osztrogonác <ossy>
Component: New BugsAssignee: Csaba Osztrogonác <ossy>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, ossy, sam
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch achristensen: review+, achristensen: commit-queue-

Description Csaba Osztrogonác 2015-09-21 07:47:36 PDT
There are many warnings come from IDLParser.pm because of using uninitialized value in regexps:

Use of uninitialized value $type in pattern match (m//) at /home/ossy/WebKit/Source/WebCore/bindings/scripts/IDLParser.pm line 303.
Use of uninitialized value $type in substitution (s///) at /home/ossy/WebKit/Source/WebCore/bindings/scripts/IDLParser.pm line 309.
Comment 1 Csaba Osztrogonác 2015-09-21 07:49:35 PDT
Created attachment 261655 [details]
Patch
Comment 2 Alex Christensen 2015-09-21 16:22:22 PDT
Comment on attachment 261655 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=261655&action=review

r=me with nit

> Source/WebCore/bindings/scripts/IDLParser.pm:311
> +   }

This needs another space of indentation.
Comment 3 Csaba Osztrogonác 2015-09-22 02:24:25 PDT
(In reply to comment #2)
> Comment on attachment 261655 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=261655&action=review
> 
> r=me with nit
> 
> > Source/WebCore/bindings/scripts/IDLParser.pm:311
> > +   }
> 
> This needs another space of indentation.

Good catch, I'll fix it before landing.
Comment 4 Csaba Osztrogonác 2015-09-22 02:32:34 PDT
Committed r190111: <http://trac.webkit.org/changeset/190111>
Comment 5 Chris Dumez 2015-09-22 18:55:24 PDT
Comment on attachment 261655 [details]
Patch

This looks like this may be papering over a real bug. How can an attribute or parameter not have a type?
Comment 6 Chris Dumez 2015-09-22 19:02:59 PDT
It looks like the parser has trouble parsing:
[Unscopeable, RaisesException, Custom] void prepend((Node or DOMString)... nodes);
[Unscopeable, RaisesException, Custom] void append((Node or DOMString)... nodes);
in ParentNode.idl

and

[Unscopeable, RaisesException, Custom] void before((Node or DOMString)... nodes);
[Unscopeable, RaisesException, Custom] void after((Node or DOMString)... nodes);
[Unscopeable, RaisesException, Custom] void replaceWith((Node or DOMString)... nodes);
in ChildNode.idl

Likely the issue is that our parser does not support unions or variadic arguments.

Thankfully, even though the parser does not parse them properly, it does not cause problems because we use Custom bindings for these.

The proper fix would be to add support for these type of parameters to our IDL parser.
Comment 7 Chris Dumez 2015-09-22 19:05:22 PDT
FYI, the problem is unions (Node or DOMString). Variadic parameters seem to be fine.
Comment 8 Csaba Osztrogonác 2015-09-28 02:51:56 PDT
(In reply to comment #7)
> FYI, the problem is unions (Node or DOMString). Variadic parameters seem to
> be fine.

Could you file a new bug report for this issue?