Closed GoogleCodeExporter closed 9 years ago
Removing eval in line
http://code.google.com/p/jqueryrotate/source/browse/trunk/jQueryRotate.js?spec=s
vn127&r=120#16
fixes the issue.
Original comment by itk...@gmail.com
on 16 Sep 2012 at 11:32
In compressed version it's cut off, please read comment above.:)
Original comment by wil...@gmail.com
on 17 Sep 2012 at 6:24
No, it is not. At least not with the Closure compiler I have:
% java -jar tools/compiler.jar --version
Closure Compiler (http://code.google.com/closure/compiler)
Version: 1592
Built on: 2011/11/17 10:24
^C%
% grep eval jQueryRotate.2.2.with.eval.js
// Bad eval to preven google closure to remove it from code o_O
var IE = eval('"v"=="\v"');
% java -jar tools/compiler.jar --js jQueryRotate.2.2.with.eval.js >
jQueryRotate.2.2.with.eval.min.js
% grep eval jQueryRotate.2.2.with.eval.min.js
(function(j){for(var
d,k=document.getElementsByTagName("head")[0].style,h="transformProperty
WebkitTransform OTransform msTransform MozTransform".split("
"),g=0;g<h.length;g++)void 0!==k[h[g]]&&(d=h[g]);var
i=eval('"v"=="\u000b"');jQuery.fn.extend({rotate:function(a){if(!(0===this.lengt
h||"undefined"==typeof a)){"number"==typeof a&&(a={angle:a});for(var
b=[],c=0,f=this.length;c<f;c++){var
e=this.get(c);if(!e.Wilq32||!e.Wilq32.PhotoEffect){var
d=j.extend(!0,{},a),e=(new Wilq32.PhotoEffect(e,d))._rootObj;
Original comment by itk...@gmail.com
on 18 Sep 2012 at 12:02
U re using google closure, but there is a comment about google closure:
// Bad eval to preven google closure to remove it from code o_O
// After compresion replace it back to var IE = 'v' == '\v'
I also use google closure when making compressed version, unfortunately eval is
needed there to make sure that closure will leave it in (otherwise it will be
removed by Closure optimization methods)
Original comment by wil...@gmail.com
on 18 Sep 2012 at 6:21
Aren't there better ways to test for IE? Some restricted environments like
Google Chrome's packaged apps will not execute evals at all, so the library is
broken there. Whether or not some js compressors will remove or replace eval
with something else is irrelevant, it's bad no matter how you look at it and
it's not like eval is really needed here.
Original comment by itk...@gmail.com
on 18 Sep 2012 at 1:33
I'm open for better IE detection methods :) This one I use is best, only
problem is that google compiler remove it completly from code ( this var IE
= 'v' == '\v' )
Original comment by wil...@gmail.com
on 18 Sep 2012 at 1:37
Will try with a !!window.ActiveXObject detection
Original comment by wil...@gmail.com
on 30 Jun 2013 at 8:24
Original issue reported on code.google.com by
itk...@gmail.com
on 16 Sep 2012 at 11:31