Skip to content
Browse files

- little cleanup. the newest parent function now always overwrites t…

…he oldest one (and its way more l33t, I mean, seriously, arguments.callee.caller.parent.apply(this, arguments)).

 - fixed a couple of strict js warnings.

git-svn-id: http://svn.mootools.net/trunk@1533 4db308c1-fb21-0410-9919-de62e267375e
  • Loading branch information...
1 parent 75ebd2a commit 56150f642df5349fc8b69f5363cd2981e20ad2e2 kamicane committed Apr 10, 2008
Showing with 9 additions and 15 deletions.
  1. +8 −14 Source/Class/Class.js
  2. +1 −1 Source/Plugins/Tips.js
View
22 Source/Class/Class.js
@@ -57,20 +57,12 @@ Class.Mutators.Implements = function(self, klasses){
Class.Mutators.Extends = function(self, klass){
- self.parent = function(){
- return this.parent.caller.parent.apply(this, arguments);
- };
-
- klass = new klass($empty);
+ var instance = new klass($empty), current;
- for (var property in klass) self[property] = (function(previous, current){
-
+ for (var property in instance) self[property] = (function(previous, current){
if (current != undefined && previous != current){
-
var type = $type(current), ptype = $type(previous);
-
if (type != ptype) return current;
-
switch (type){
case 'function':
return function(){
@@ -80,10 +72,12 @@ Class.Mutators.Extends = function(self, klass){
case 'object': return $merge(previous, current);
default: return current;
}
-
}
-
return previous;
-
- })(klass[property], self[property]);
+ })(instance[property], (current = self[property]));
+
+ self.parent = function(){
+ return arguments.callee.caller.parent.apply(this, arguments);
+ };
+
};
View
2 Source/Plugins/Tips.js
@@ -26,7 +26,7 @@ var Tips = new Class({
initialize: function(){
var params = Array.link(arguments, {options: Object.type, elements: $defined});
- this.setOptions(params.options);
+ this.setOptions(params.options || null);
this.tip = new Element('div').inject(document.body);

0 comments on commit 56150f6

Please sign in to comment.
Something went wrong with that request. Please try again.