Bug 52837

Summary: [v8] CodeGeneratorV8 generates incorrect code for callbacks with no parameters
Product: WebKit Reporter: James Robinson <jamesr>
Component: New BugsAssignee: James Robinson <jamesr>
Status: RESOLVED FIXED    
Severity: Normal CC: japhet, jorlow, levin, pfeldman, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 51218    
Attachments:
Description Flags
Patch japhet: review+

Description James Robinson 2011-01-20 13:08:35 PST
[v8] CodeGeneratorV8 generates incorrect code for callbacks with no parameters
Comment 1 James Robinson 2011-01-20 13:22:53 PST
Created attachment 79643 [details]
Patch
Comment 2 Nate Chapin 2011-01-20 13:31:07 PST
Comment on attachment 79643 [details]
Patch

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

> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:2406
> +            } else {
> +                push(@implContent, "\n    v8::Handle<v8::Value> *argv = 0;\n\n");
> +            }

Nit: no {} for the else statement
Comment 3 James Robinson 2011-01-20 13:38:25 PST
(In reply to comment #2)
> (From update of attachment 79643 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=79643&action=review
> 
> > Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:2406
> > +            } else {
> > +                push(@implContent, "\n    v8::Handle<v8::Value> *argv = 0;\n\n");
> > +            }
> 
> Nit: no {} for the else statement

The other one-line conditionals in this file seem to use {}s
Comment 4 Nate Chapin 2011-01-20 13:39:36 PST
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 79643 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=79643&action=review
> > 
> > > Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:2406
> > > +            } else {
> > > +                push(@implContent, "\n    v8::Handle<v8::Value> *argv = 0;\n\n");
> > > +            }
> > 
> > Nit: no {} for the else statement
> 
> The other one-line conditionals in this file seem to use {}s

Hmm....I had forgotten that.  nvm then.
Comment 5 James Robinson 2011-01-20 13:40:09 PST
Committed r76277: <http://trac.webkit.org/changeset/76277>
Comment 6 Adam Barth 2011-01-20 15:05:21 PST
Comment on attachment 79643 [details]
Patch

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

>>>> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:2406
>>>> +            } else {
>>>> +                push(@implContent, "\n    v8::Handle<v8::Value> *argv = 0;\n\n");
>>>> +            }
>>> 
>>> Nit: no {} for the else statement
>> 
>> The other one-line conditionals in this file seem to use {}s
> 
> Hmm....I had forgotten that.  nvm then.

I think they're required in Perl.