Hello
This fork isn't really a 140bytes entry, but a challenge!
What if a tweet (140 utf-16 characters) could execute more than 140 characters of JavaScript code?
thanks to subzey's help, a tweet can execute 190 js chars.
Encoder:
z=function(b,c,a,f){c="";f=String.fromCharCode;for(a=0;190>a;a+=2)c+=f(55296+b.charCodeAt(a))+f(56320+b.charCodeAt(a+1));return c}
Decoder / Executer (140 chars): (replace xxxx with your encoded JS string)
eval(unescape(escape("xxxx").replace(/uD./g,'')))
Demo:
Uh… Very nice try, but unfortunately, there's an error.
I tried the following:
alert("It works!");;;;;/* … more semicolons fills up to 198 chars*/
and after running the generated code got SyntaxError.
In short,
var \u0066\u006f\u006f = 42
would work, butvar \u0066\u006f\u006f \u003d 42
wouldn't. Please see http://es5.github.io/#x7.6 for details.