Bug 150446
| Summary: | Clean binding generated code for custom attribute setters and getters | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | youenn fablet <youennf> |
| Component: | WebCore JavaScript | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | ossy |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
youenn fablet
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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
youenn fablet
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.
youenn fablet
*** This bug has been marked as a duplicate of bug 158068 ***