in partnership with mediatemple

Changeset 1542

Show
Ignore:
Timestamp:
04/21/08 14:57:34 (3 weeks ago)
Author:
kamicane
Message:
  • fixed another opera bug: the function toString removes the parentheses around numbers, and returns an error. I force them back in the regexp. Thanks RD for the report.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/Source/Class/Class.js

    r1541 r1542  
    8686                                // if future opera versions will support function.caller, this code wont be executed anymore. 
    8787                                // this code will be only executed if the current browser does not support function.caller (only opera). 
     88                                // there is also a fix for an opera bug where in the function string, parentheses around numbers are ignored, and an error is thrown. 
    8889                                 
    8990                                if (!arguments.callee.caller) self[key] = eval('(' + String(current).replace(/\bthis\.parent\(\s*(\))?/g, function(full, close){ 
    9091                                        return 'arguments.callee._parent_.call(this' + (close || ', '); 
    91                                 }) + ')'); 
     92                                }).replace(/(\d+)\.([A-Za-z_])/, '($1).$2') + ')'); 
    9293                                 
    93                                 //end "opera" code 
     94                                // end "opera" code 
    9495                         
    9596                                self[key]._parent_ = previous;