Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#18842 closed defect (fixed)

declare only merges "-chains-" in mixins (not superclasses)

Reported by: Bryan Forbes Owned by: Michael Van Sickle <mvansickle@…>
Priority: undecided Milestone: 1.11.3
Component: Core Version: 1.11.1
Keywords: Cc:
Blocked By: Blocking:

Description

The following code demonstrates the issue:

var A = declare([], {
        '-chains-': {
                initialize: 'after'
        },

        initialize: function () {
                console.log('initialize in A');
        },

        other: function () {
                console.log('other in A');
        },

        postscript: function () {
                this.inherited(arguments);
                this.initialize();
        }
});

var B = declare(A, {
        '-chains-': {
                other: 'after' 
        },

        initialize: function () {
                console.log('initialize in B');
        },

        other: function () {
                console.log('other in B');
        },

        postscript: function () {
                this.inherited(arguments);
                this.other();
        }
});

new A();
// logs out the following (expected):
// initialize in A

new B();
// logs out the following (unexpected):
// initialize in B
// other in A
// other in B

The following code in declare.js is only taking into account mixins and not the superclass:

                // collect chains and flags
                for(i = mixins - 1; i; --i){ // intentional assignment
                        t = bases[i]._meta;
                        if(t && t.chains){
                                chains = mix(chains || {}, t.chains);
                        }
                }

Change History (5)

comment:1 Changed 3 years ago by dylan

Component: GeneralCore
Milestone: tbd1.11.3

comment:2 Changed 3 years ago by Michael Van Sickle <mvansickle@…>

Owner: set to Michael Van Sickle <mvansickle@…>
Resolution: fixed
Status: newclosed

In d1d3bcd/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:3 Changed 3 years ago by Michael Van Sickle <mvansickle@…>

In d953827/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:4 Changed 3 years ago by Michael Van Sickle <mvansickle@…>

In 27a9458/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:5 Changed 3 years ago by Michael Van Sickle <mvansickle@…>

In c701187/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 
Note: See TracTickets for help on using tickets.