Fun impossible Firefox JS challenge

gaz Heyes gazheyes at gmail.com
Fri Apr 13 01:01:33 PDT 2012


Ok here is my solution:

with(arguments.callee)function::['true']()

So initially I thought the with statement was required to switch the
context of "function::" but this also worked:
with(1+1)function::['true']()

However this doesn't work on Firefox 11:
function::['true']()

So what I think happens is Firefox looks for the true function in the
window object then can't find it so falls back to the parent object with is
the current anon function.

It can also be called using eval as eval is in the current scope:
eval("function::['true']()");

I guess the shortest you can possibly make it is:
with(1)function::true()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120413/a41c2ea7/attachment.html>


More information about the es-discuss mailing list