-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Method removeChild():DisplayObject never returns null #777
Comments
removeChild():DisplayObject
never returns null
hey, b005t3r. i'm sure you know that what Starling has is compatible with the Flash API and changing it could break for some users. but i do agree, what you suggest makes sense, because the caller already has a reference to the DisplayObject passed to removeChild()...and i don't think there are many users that grab the result from removeChild() as it's a known instance. in the Flash API the removeChild() return is such so that it's similar to the removeChildAt(). possibly a viable change. contains() also exists, which BTW i think can be simplified in the current source from:
to:
|
Makes sense! I agree that this return value doesn't have much worth currently; I just did it that way because the Flash API does it like that. So it makes sense to change it to something more useful. I'll think about it! @neolit123: the |
BTW, any comments on the |
I have no idea how old Flash API works, obviously, but what I suggested is based on how a very robust JAVA Collection framework works - all methods like So that's my vote for changing the way it works currently to returning |
i see, makes perfect sense. |
Thanks, guys! I'm leaning towards making that change in the 2.0 branch. =) |
I must admit I totally forgot about that ... @joshtynjala What do you think about this? Would it help / be a problem for Feathers if I changed this? |
I don't think I use the return value from removeChild() anywhere in Feathers. I don't think it would break anything. |
Closed with 1f08c5a. |
I'd expect
removeChild()
to returnnull
if the given child was not removed (because it's not a child of the given parent), so I could, for example, use it to check if the parent has changed as a result of this call.Currently, it always returns the object passed as
child
, which is not really that useful.The text was updated successfully, but these errors were encountered: