#2178 closed bug (wontfix)
isFunction won't work correctly on Opera mobile
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | major | Milestone: | 1.2.3 |
Component: | core | Version: | 1.2.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
As explained on http://my.opera.com/hallvors/blog/show.dml/1665828 : on limited platforms like mobiles, Opera's Function.prototype.toString does not return source code (due to the memory- and footprint cost of decompiling) so this part of the isFunction method will fail:
/function/i.test( fn + "" )
May I suggest adding the below workaround somewhere?
if( (function(){}).toString().match(/\[ecmascript/i) ) Function.prototype.toString = function(){return 'function'};
Note: See
TracTickets for help on using
tickets.
We don't extend native object prototypes - no matter the situation. As far as your suggestion from the blog post, that'll work just fine for us: