Bug 149759 - JSBuiltinConstructor must always add builtin header
Summary: JSBuiltinConstructor must always add builtin header
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Xabier Rodríguez Calvar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-02 12:30 PDT by Xabier Rodríguez Calvar
Modified: 2015-10-06 03:17 PDT (History)
7 users (show)

See Also:


Attachments
Patch (2.23 KB, patch)
2015-10-02 12:32 PDT, Xabier Rodríguez Calvar
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xabier Rodríguez Calvar 2015-10-02 12:30:43 PDT
JSBuiltinConstructor must always add builtin header
Comment 1 Xabier Rodríguez Calvar 2015-10-02 12:32:53 PDT
Created attachment 262345 [details]
Patch

If you compile the previously generated file with the initialization function ready in the .js file, compilation was failing because the header file couldn't be found. It is actually needed because the builtins include already the initialization function.
Comment 2 youenn fablet 2015-10-04 23:40:07 PDT
LGTM
Comment 3 youenn fablet 2015-10-05 01:02:27 PDT
Comment on attachment 262345 [details]
Patch

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

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:5120
> +        return 1;

Just for style, returning 1 is not needed anymore.
It might be better to refactor the whole routine accordingly.
Comment 4 Xabier Rodríguez Calvar 2015-10-05 01:24:36 PDT
(In reply to comment #3)
> Comment on attachment 262345 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=262345&action=review
> 
> > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:5120
> > +        return 1;
> 
> Just for style, returning 1 is not needed anymore.
> It might be better to refactor the whole routine accordingly.

I could rewrite to have a if-then and avoid that. I did it like this to pullute the patch less though it is not big deal, of course. What I can't avoid is the return inside the loop because it is supposed to bail out the first time it adds the header.
Comment 5 Xabier Rodríguez Calvar 2015-10-05 10:19:44 PDT
(In reply to comment #4)
> > > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:5120
> > > +        return 1;
> > 
> > Just for style, returning 1 is not needed anymore.
> > It might be better to refactor the whole routine accordingly.
> 
> I could rewrite to have a if-then and avoid that. I did it like this to
> pollute the patch less though it is not big deal, of course. What I can't
> avoid is the return inside the loop because it is supposed to bail out the
> first time it adds the header.

Darin, wdyt about this? Should I change this when landing or do you like it as it is now?
Comment 6 youenn fablet 2015-10-05 14:24:46 PDT
One possibility for the refactoring would be to transform AddIncludesForJSBuiltinMethods into something like NeedsJSBuiltinsInclude.

If you prefer to land this one directly, I can handle it in a follow-up patch.
Comment 7 Xabier Rodríguez Calvar 2015-10-06 00:16:27 PDT
Comment on attachment 262345 [details]
Patch

(In reply to comment #6)
> One possibility for the refactoring would be to transform
> AddIncludesForJSBuiltinMethods into something like NeedsJSBuiltinsInclude.
> 
> If you prefer to land this one directly, I can handle it in a follow-up
> patch.

I can't do anything else than landing this since I'd need Darin's blessing for any other thing.
Comment 8 WebKit Commit Bot 2015-10-06 01:02:31 PDT
Comment on attachment 262345 [details]
Patch

Clearing flags on attachment: 262345

Committed r190610: <http://trac.webkit.org/changeset/190610>
Comment 9 WebKit Commit Bot 2015-10-06 01:02:38 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 youenn fablet 2015-10-06 03:17:20 PDT
Filed https://bugs.webkit.org/show_bug.cgi?id=149837 as a follow-up