Remove WebIDL userdata

RESOLVED INCOMPLETE

Status

()

RESOLVED INCOMPLETE
6 years ago
5 years ago

People

(Reporter: khuey, Assigned: khuey)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Created attachment 654234 [details] [diff] [review]
Patch

It only has one use, and it's kind of ugly, so lets ditch it.
Attachment #654234 - Flags: review?(justin.lebar+bug)
>         # If we're concrete, we need to crawl our ancestor interfaces and mark
>         # them as having a concrete descendant.
>         self.concrete = desc.get('concrete', True)
>         if self.concrete:
>             iface = self.interface
>             while iface:
>-                iface.setUserData('hasConcreteDescendant', True)
>+                if iface.isExternal():
>+                    break

It's not clear to me why we should stop the first external interface in the parent chain.

>+                iface.setHasConcreteDescendant(True)

iface.hasConcreteDescendent = True would be more Pythonic, I think.  You could
always make hasConcreteDescendent a property at some point in the future, if
you wanted to take some action when the value was set.
Attachment #654234 - Flags: review?(justin.lebar+bug) → review+
You can't have an external interface with a real interface parent, afaik.

hasConcreteDescendant is more pythonic, but elsewhere we've used the setFoo stuff.
> but elsewhere we've used the setFoo stuff.

It's only setIsConsequentialInterfaceOf, and setCallback (which should be called setIsCallback), afaict.  What if I volunteered to fix those two?
Comment on attachment 654234 [details] [diff] [review]
Patch

If a concrete interface inherits from an external interface, don't we just want to throw?
(In reply to Justin Lebar [:jlebar] from comment #3)
> > but elsewhere we've used the setFoo stuff.
> 
> It's only setIsConsequentialInterfaceOf, and setCallback (which should be
> called setIsCallback), afaict.  What if I volunteered to fix those two?

I'd be fine with that.  I'm mostly interested in consistency.
Actually, seIsConsequentialInterfaceOf(x) is not the same type of thing -- it's basically self.myConsequentialInterfaces.append(x).  So it's just the isCallback guy.
And if we made isCallback a property, we'd have to change isDictionary, isInterface...I guess that's a job for later.  :)
(In reply to Boris Zbarsky (:bz) [In and out Aug 1 - 10, out Aug 11-20] from comment #4)
> Comment on attachment 654234 [details] [diff] [review]
> Patch
> 
> If a concrete interface inherits from an external interface, don't we just
> want to throw?

Done.
We're using this for things now.  May want to revisit it later but it's not important.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.