Possible bug in Safari with fireEvent

  1. #1

    Possible bug in Safari with fireEvent

    Hi,

    I noticed that when I call:
    var record = #{MyGrid}.getStore().getById(record_id);
    record.set('some_data', 'test');
    In Safari this code throws an error: 'undefined is not an object'
    and after some tracing, the problem was located in
    Ext.util.Observable.fireEvent()

    fireEvent: function () {
            var a = Array.prototype.slice.call(arguments, 0),
                ename = a[0].toLowerCase(),
                me = this,
                ret = true,
                ce = me.events[ename],
                cc,
                q,
                c;
            if (me.eventsSuspended === true) {
                if (q = me.eventQueue) {
                    q.push(a);
                }
            }
            else if (typeof ce == 'object') {
                if (ce.bubble) {
                    if (ce.fire.apply(ce, a.slice(1)) === false) {
                        return false;
                    }
    
                    c = me.getBubbleTarget && me.getBubbleTarget();
                    if (c && c.enableBubble) {
                        cc = c.events[ename];
                        if (!cc || typeof cc != 'object' || !cc.bubble) {
                            c.enableBubble(ename);
                        }
                        return c.fireEvent.apply(c, a);
                    }
                }
                else {
                    a.shift();
                    ret = ce.fire.apply(ce, a);
                }
            }
            return ret;
        }
    The problem was in this line of code at the end:

    ret = ce.fire.apply(ce, a);
    I don't now but somehow Safari throws an error, and this is native javascript function, so I suspect it's some internal error in the Safari Javascript engine.
    I get this case only with the record.set() function, I didn't found this kind of error in other fireEvent cases. This is tested in the latest Safari for Windows (5.1.7) and for Mac OS X (6.0.2).

    By the way I solved the problem with overriding this function, and wrapping the problematic code with try-catch block, but I was wondering if someone else got the same problem, and what kind of solution is used.
  2. #2
    Hello!

    Can you provide sample of this problem?

Similar Threads

  1. [CLOSED] Difference layout Safari Ipad vs Safari PC
    By CarWise in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 05, 2013, 3:52 AM
  2. [CLOSED] FireEvent('selectionchange')
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 09, 2013, 7:54 PM
  3. [CLOSED] fireEvent while chaging value of textfield from code behind
    By FpNetWorth in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 05, 2011, 8:12 PM
  4. Replies: 0
    Last Post: Aug 04, 2009, 9:57 AM
  5. [CLOSED] ComboBox FireEvent on Coolite 0.8.2
    By macap in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 03, 2009, 10:47 AM

Tags for this Thread

Posting Permissions