https://bugzilla.wikimedia.org/show_bug.cgi?id=57037

       Web browser: ---
            Bug ID: 57037
           Summary: oo.EventEmitter#disconnect shouldn't fail if there are
                    no event bindings to disconnect
           Product: OOJS
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: Unprioritized
         Component: EventEmitter
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]
    Classification: Unclassified
   Mobile Platform: ---

surface.disconnect( this, { 'toolbarPosition': 'positionPhantoms' } );
This throws Uncaught TypeError: Cannot read property 'length' of undefined when
no such event has been bound first.

oo.EventEmitter.prototype.disconnect = function ( context, methods ) {
    /* .. */
        for ( event in methods ) {
            method = methods[event];
            /* .. */
            bindings = this.bindings[event];
            i = bindings.length; /* ! */
It should silently skip it.


----
Moved from https://github.com/trevorparscal/oojs/issues/18.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to