arguments.callee in Harmony

Yehuda Katz wycats at gmail.com
Fri Sep 25 22:19:29 PDT 2009


Or never? I can't shake the feeling that strict mode is a sop to
people with minority opinions, but which will end up shaping the
future of ES going forward.

-- Yehuda

On Fri, Sep 25, 2009 at 9:01 PM, Mark S. Miller <erights at google.com> wrote:
> On Fri, Sep 25, 2009 at 2:24 PM, Charles Jolley <charles at sproutit.com> wrote:
>> PS. Is there an official way to detect that I am running code in ES5 strict mode?  I can't find it in the spec.
>
> To summarize:
>
> A conventional pattern for testing "Am I in >= ES5 strict mode?" is
>
>    if (function(){return this;}()) {
>      // I am not in strict mode
>    } else {
>      // I am in strict mode, and therefore in >= ES5
>    }
>
> A conventional pattern for testing "Am I in >= ES5?" is
>
>    if (function(){"use strict";return this;}()) {
>      // I am in < ES5
>    } else {
>      // I am in >= ES5
>    }
>
> For these to work, it is important that browser makers rolling out ES5
> features incrementally not cause the ES5-sides of these tests to
> succeed until their ES5 system is complete. In other words, much as it
> pains me to suggest this, please implement strict mode last.
>
>
> --
>    Cheers,
>    --MarkM
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>



-- 
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325


More information about the es-discuss mailing list