Modify ↓
Ticket #2178 (closed bug: wontfix)
isFunction won't work correctly on Opera mobile
| Reported by: | hallvord @… | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.2.3 |
| Component: | core | Version: | 1.2.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
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'};
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
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: