Results 1 to 2 of 2

Thread: [CLOSED][EXT 4.0.2] Ext.bind - do not work in FF if function undefined

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User eliotik's Avatar
    Join Date
    May 2010
    Vote Rating

    Default [CLOSED][EXT 4.0.2] Ext.bind - do not work in FF if function undefined


    i have js source in which exists next line
    Ext.bind(this.formatData, this)
    this js file loaded by Ext.Loader

    in Firefox(6.0) if formatData undefined i got no errors by script stops to run
    but in Chrome i got next error
    Uncaught TypeError: Cannot call method 'apply' of undefined
    in ext-all-debug-w-comments.js on line 2367
    bind: function(fn, scope, args, appendArgs) {
            var method = fn,
                slice = Array.prototype.slice;
            return function() {
                var callArgs = args || arguments;
                if (appendArgs === true) {
                    callArgs =, 0);
                    callArgs = callArgs.concat(args);
                else if (Ext.isNumber(appendArgs)) {
                    callArgs =, 0); // copy arguments first
                    Ext.Array.insert(callArgs, appendArgs, args);
                return method.apply(scope || window, callArgs); //<---- line 2367ext-all-debug-w-comments.js:2367Uncaught TypeError: Cannot call method 'apply' of undefined

  2. #2
    Sencha User mberrie's Avatar
    Join Date
    Feb 2011
    Bangkok, Thailand
    Vote Rating


    What behavior do you expect?

    If your issue is with inconsistent error reporting between browsers, then this is not an Ext issue. Calling a method on a null reference is a standard Javascript error and the browser should report it.

    This works for me as expected on FF6 with Firebug 1.8b2 (note that I added brackets to execute the function returned by Ext.bind):

    Ext.bind(this.formatData, this)( )  // error msg -> 'method is undefined'

    Maybe you would like Ext to throw an exception when calling Ext.bind with a null reference (not just upon execution of the generated function).
    Well, personally, I tend to agree. However, I found that parameter checking is hardly ever done in Ext (and Javascript coding in general), and this seems to be 'by design'.

    I am not around here long enough to know if error handling has been discussed before. I've seen some improvements in Ext4 what seems to be extended error handling in the 'debug versions' of Ext. But I doubt that there has been a policy change.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts