In what ways does the following "eval" regularity break?

Mark S. Miller erights at google.com
Thu Oct 30 11:12:35 PDT 2008


On Thu, Oct 30, 2008 at 11:00 AM, Maciej Stachowiak <mjs at apple.com> wrote:
> In recent WebKit versions, this test prints PASS twice:
>
> <pre><script>
> var a = "PASS";
> function foo(a, b, c) { return b(c); }
> document.writeln(foo(3, eval, 'a'));
> document.writeln(foo(3, window.eval, 'a'));
> </script></pre>
>
> (prints nothing if you remove the to-level var a declaration).
>
> Opera matches this behavior.
>
> In a recent Firefox nightly it also prints PASS twice, but FAIL twice if you
> remove the top-level declaration. That seems in line with your results
> above. I agree that is puzzling.

What's FAIL?


-- 
    Cheers,
    --MarkM


More information about the Es-discuss mailing list