Bug 150446 - Clean binding generated code for custom attribute setters and getters
Summary: Clean binding generated code for custom attribute setters and getters
Status: RESOLVED DUPLICATE of bug 158068
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-22 08:14 PDT by youenn fablet
Modified: 2016-06-21 08:03 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2015-10-22 08:14:33 PDT
As pointed out by Ossy in bug 150438, the binding generator code for custom attribute getters and/or setters should be fixed:

> > Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:158
> > +EncodedJSValue jsTestJSBuiltinConstructorTestAttributeCustom(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
> > +{
> > +    UNUSED_PARAM(state);
> > +    UNUSED_PARAM(slotBase);
> > +    UNUSED_PARAM(thisValue);
> > +    auto* castedThis = jsCast<JSTestJSBuiltinConstructor*>(slotBase);
> > +    return JSValue::encode(castedThis->testAttributeCustom(*state));
> > +}
> 
> state and slotBase parameters are used. thisValue is really unused, 
> but in this case omitting the parameter name would be better.
Comment 1 youenn fablet 2015-10-22 08:25:25 PDT
After a quick look at the  binding generator code for attribute getters/setters, it contains many "if" statements.
It is not always easy to identify whether each variable is used or not, depending on the different generation options.
Hence the current code I guess.
Comment 2 youenn fablet 2016-06-21 08:03:13 PDT

*** This bug has been marked as a duplicate of bug 158068 ***