Permalink
Browse files

Calling this. Everywhere.

  • Loading branch information...
1 parent 3b917db commit b43547b0360cd3fa225bf0d319b42fdacfd60bb8 @cpojer cpojer committed Feb 15, 2011
@@ -259,4 +259,4 @@ this.$exec = Browser.exec;
//</1.2compat>
-})();
+}).call(this);
@@ -118,4 +118,4 @@ this.Options = new Class({
});
-})();
+}).call(this);
@@ -112,4 +112,4 @@ Class.Mutators = {
}
};
-})();
+}).call(this);
View
@@ -507,4 +507,4 @@ this.$unlink = function(object){
//</1.2compat>
-})();
+}).call(this);
@@ -241,7 +241,7 @@ function getCompatElement(element){
return (!doc.compatMode || doc.compatMode == 'CSS1Compat') ? doc.html : doc.body;
};
-})();
+}).call(this);
//aliases
Element.alias({position: 'setPosition'}); //compatability
@@ -172,4 +172,4 @@ Element.Events = new Hash(Element.Events);
//</1.2compat>
-})();
+}).call(this);
@@ -180,4 +180,4 @@ Element.ShortStyles = {margin: {}, padding: {}, border: {}, borderWidth: {}, bor
Short.borderColor[bdc] = Short[bd][bdc] = All[bdc] = 'rgb(@, @, @)';
});
-})();
+}).call(this);
View
@@ -176,4 +176,4 @@ var pullInstance = function(fps){
}
};
-})();
+}).call(this);
@@ -76,4 +76,4 @@ JSON.decode = function(string, secure){
return eval('(' + string + ')');
};
-})();
+}).call(this);
@@ -110,4 +110,4 @@ Swiff.remote = function(obj, fn){
return eval(rs);
};
-})();
+}).call(this);

4 comments on commit b43547b

@asuth
asuth commented on b43547b Feb 24, 2011

What is the purpose of this commit? Just curious, thanks!

@SunboX
SunboX commented on b43547b Feb 24, 2011

Maybe you could overwrite call() function later? To do some tricks or so ... ;o) don´t know :D

@kassens
Member

this in the outer scope refers to the global object. In a browser the global object is window, but in other environments like Node.js it's called otherwise. (global in node's case). That's why we use this.Class = ...; to define the global variable Class. Strict mode of ecmascript 5 doesn't allow to use this in unbound functions, that's why the this of the closure is explicitly bound to the this of the global scope.

@SunboX
SunboX commented on b43547b Feb 24, 2011

Ah, cool! Thanks for the lesson! :o)

Please sign in to comment.