Fun impossible Firefox JS challenge

gaz Heyes gazheyes at gmail.com
Thu Apr 12 05:58:06 PDT 2012


Hey all

Just thought I'd post a bit of fun related to the Firefox JS parser.

!function(){

function true(){alert('Call me');};

/* YOUR CODE */

}();

The trick is to execute the function "true" from within the function
expression.

Rules:
1. Your code must be within the function expression as indicated by the
comment.
2. You cannot redefine "true" anywhere else including window etc.
3. You must call the actual function as defined in the original code.

This is just for fun and should be impossible but it does highlight a
couple of things, 1) JavaScript has no way to reference inner functions
that are not a property of the object without directly calling their name.
2) Mozilla JS devs are crazy (in a nice way)

Cheers

Gareth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120412/3413e567/attachment.html>


More information about the es-discuss mailing list