Last modified: 2014-07-12 10:18:52 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T57557, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55557 - OOjs: Mixin doesn't work properly with inherited classes
OOjs: Mixin doesn't work properly with inherited classes
Status: RESOLVED INVALID
Product: OOjs
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: High normal
: ---
Assigned To: Editing team bugs – take if you're interested!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-10 12:25 UTC by Ed Sanders
Modified: 2014-07-12 10:18 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Ed Sanders 2013-10-10 12:25:16 UTC
Example:
ve.ce.MWBlockImageNode mixes in ve.ce.MWResizableNode which inherits from ve.ce.ResizableNode, however the methods from ve.ce.ResizableNode are not mixed in automatically if you just mix in ve.ce.MWResizableNode.
Comment 1 Krinkle 2014-07-12 10:18:52 UTC
This is by design.

Mixing in a class only copies over own properties. Not inherited properties.

JavaScript can't have an object inherit from multiple parents. We have the convention to not alter mixins once defined. So copying over one is fine. But the parent of a mixin, I'm not so sure (and we'd have to distinguish it from any prototypes in the chain we don't want to copy manually, such as Function prototype and Object prototype).

If the "sub mixin" doesn't care about live inheritance (and it can't care, because mixins can't be live since they always copy over), then the sub mixin should just use 'mixin' for its 'parent' not 'inherit'.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links