Take a look at Zepto, thats where I stole the trick from :)


On Mon, Feb 24, 2014 at 6:11 PM, Roman Bataev <notifications@github.com>wrote:

> In lib/dom/dynamic.js:
>
> > +      throw new Error('SecurityError: dynamic code must be enabled with evil flag');
> > +    };
> > +    window.Function.prototype = $Function.prototype;
> > +  }
> > +
> > +  var $setTimeout = window.setTimeout;
> > +  window.setTimeout = function(callback, timeout/*, [args...]*/ ) {
> > +    var args = arguments;
> > +
> > +    if (typeof callback === 'string') {
> > +      if (!options.evil) {
> > +        throw new Error('SecurityError: dynamic code must be enabled with evil flag');
> > +      } else {
> > +        args = _.toArray(arguments);
> > +        args[0] = function() {
> > +          (1,window.eval)(callback);
>
> Wow. Thanks.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/walmartlabs/fruit-loops/pull/17/files#r10018311>
> .
>