Bug Tracker

Ticket #3134: toString-complex-but-ok.diff

File toString-complex-but-ok.diff, 690 bytes (added by genezys, 14 years ago)

Complex version but passes all tests

  • src/core.js

     
    614614
    615615        // See test/unit/core.js for details concerning this function.
    616616        isFunction: function( fn ) {
    617                 return !!fn && typeof fn != "string" && !fn.nodeName &&
    618                         fn.constructor != Array && /^[\s[]?function/.test( fn + "" );
     617                return !!fn && typeof fn != "string" && !fn.nodeName
     618                        && fn.constructor != Array
     619                        && ( typeof fn.prototype == "object"
     620                                || typeof fn.prototype == "function"
     621                                || (''+fn).indexOf('[native code]') >= 0 );
    619622        },
    620623
    621624        // check if an element is in a (or is an) XML document