The rationale for strict mode

Mark S. Miller erights at
Thu Nov 13 16:07:47 PST 2008

On Thu, Nov 13, 2008 at 2:53 PM, David-Sarah Hopwood <
david.hopwood at> wrote:

> [...] Strict mode reports many
>   error conditions, such as accessing a non-existent property of an
>   object, by throwing an exception. In non-strict mode these
>   conditions silently cause the operation to be ignored or the
>   'undefined' value to be used as the result. [...]<>

Hi David-Sarah, I like everything about your message, except that the above
example specifically is incorrect. Because the JavaScript "feature testing"
pattern is so ingrained, and because the failure does manifest in an
undefined value which is likely to be noticed, strict mode does not change
the behavior of a failed read. For the same reasons, neither does Caja.

If you change your example to a failed assignment, everything works.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Es-discuss mailing list