Permalink
Browse files

- optimized the Class replace regexp for opera. thanks sorccu!

git-svn-id: http://svn.mootools.net/trunk@1541 4db308c1-fb21-0410-9919-de62e267375e
  • Loading branch information...
1 parent 96a114a commit 29ccb88b80d44c4de6af848b35ca933a2304301e kamicane committed with subtleGradient Apr 21, 2008
Showing with 2 additions and 2 deletions.
  1. +2 −2 Source/Class/Class.js
View
4 Source/Class/Class.js
@@ -86,8 +86,8 @@ Class.Mutators.Extends = function(self, klass){
// if future opera versions will support function.caller, this code wont be executed anymore.
// this code will be only executed if the current browser does not support function.caller (only opera).
- if (!arguments.callee.caller) self[key] = eval('(' + current.toString().replace(/\bthis\.parent\((.*)\)/g, function(full, args){
- return 'arguments.callee._parent_.call(' + ((args) ? 'this, ' + args : 'this') + ')';
+ if (!arguments.callee.caller) self[key] = eval('(' + String(current).replace(/\bthis\.parent\(\s*(\))?/g, function(full, close){
+ return 'arguments.callee._parent_.call(this' + (close || ', ');
}) + ')');
//end "opera" code

0 comments on commit 29ccb88

Please sign in to comment.