New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 689925 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

"length" attribute with [ImplementedAs] breaks indexed property getters

Project Member Reported by raphael....@intel.com, Feb 8 2017

Issue description

When working on an IDL interface that supports indexed properties (ie. they have an integer-typed "length" attribute and an indexed getter), doing something like this:

  [ImplementedAs=size] readonly attribute unsigned long length;

breaks the generated bindings code. The generated "lengthAttributeGetter()" works fine and calls impl->size(), but "indexedPropertyGetter()" still calls impl->length(), which breaks the build.
 
Cc: raphael....@intel.com
I understand that it's an issue of the code generator, however, we don't want to make the code generator more complicated in general (it's already ...).

Plus, [ImplementedAs=] is not something welcome in general.  We should avoid abuse of it.

Can we workaround the issue by defining length() instead of size()?  If you need size() for maplike/setlike or some reasons, then could you define both of them in the implementation class?

IMHO, we'd rather simplify the code generator than make it more complicated, if possible.

I'm fine with no supporting [ImplementedAs=] in this case, this actually came up while I was working on https://codereview.chromium.org/2683853005/, as both core/css/cssom/CSSUnparsedValue.h and core/css/cssom/CSSTransformValue.h used size() and I wanted to change as little as possible in those classes to make the respective IDLs compliant.

Is the current situation OK, or does it at least make sense to throw an error in the code generator if one tries to use [ImplementedAs=] with length (I guess all other attribute names should be fine)?
I think the current situation is acceptably okay.  If you want, it's okay, too, to add the test to throw an error.

Comment 4 by peria@chromium.org, Mar 2 2017

Status: WontFix (was: Untriaged)

Sign in to add a comment