Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update files to not throw an error in "use strict" mode. #2379 #2380

Open
wants to merge 2 commits into from

6 participants

@GCheung55
Collaborator

@arian and @kentaromiura, check it out?

@arian
Owner

It was like this before, but it was also reverted: GCheung55@8521f48

I think that Cajon (https://github.com/requirejs/cajon) shouldn't just throw out "use strict"s outside some function scope, which it does if I understand you correctly.

@kentaromiura
Collaborator

@arian please add details
:trollface:

@DimitarChristoff
Collaborator

i like it.

@GCheung55
Collaborator

@arian Right. I think it shouldn't be aggressively enforcing 'use strict' either. But there will be cases like this, where a concat'd file has 'use strict' somewhere at the top.. and issues will occur.

The more interesting thing is that 'use strict' is inside cajon's function block scope. It shouldn't affect eval's scope.. should it?

@cpojer Could you comment why adding .call(this) was reverted? What would be a better fix?

@cpojer
Owner

iirc the problem was that the file-scope this isn't always the global context.

@SergioCrisostomo SergioCrisostomo modified the milestone: 1.5.1, 1.6.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
2  Source/Browser/Browser.js
@@ -250,4 +250,4 @@ this.$exec = Browser.exec;
//</1.2compat>
-})();
+}).call(this.window || global);
View
2  Source/Class/Class.Extras.js
@@ -118,4 +118,4 @@ this.Options = new Class({
});
-})();
+}).call(this.window || global);
View
2  Source/Class/Class.js
@@ -112,4 +112,4 @@ Class.Mutators = {
}
};
-})();
+}).call(this.window || global);
View
2  Source/Core/Core.js
@@ -518,4 +518,4 @@ this.$unlink = function(object){
//</1.2compat>
-})();
+}).call(this.window || global);
View
4 Source/Element/Element.js
@@ -365,7 +365,7 @@ Element.implement('hasChild', function(element){
return match.call(this, node, selector);
};
-})(Slick.search, Slick.find, Slick.match);
+}).call(this, Slick.search, Slick.find, Slick.match);
//</1.2compat>
@@ -1058,4 +1058,4 @@ if (document.createElement('div').getAttributeNode('id')) Element.Properties.id
};
/*</IE>*/
-})();
+}).call(this.window || global);
View
2  Source/Fx/Fx.js
@@ -176,4 +176,4 @@ var pullInstance = function(fps){
}
};
-})();
+}).call(this.window || global);
View
2  Source/Request/Request.js
@@ -275,4 +275,4 @@ Element.implement({
});
-})();
+}).call(this.window || global);
View
2  Source/Types/DOMEvent.js
@@ -111,7 +111,7 @@ DOMEvent.defineKeys({
'46': 'delete', '13': 'enter'
});
-})();
+}).call(this.window || global);
/*<1.3compat>*/
var Event = DOMEvent;
View
2  Source/Utilities/Swiff.js
@@ -110,4 +110,4 @@ Swiff.remote = function(obj, fn){
return eval(rs);
};
-})();
+}).call(this.window || global);
Something went wrong with that request. Please try again.