Re: question about strict mode violation
- Ah, thanks.
--- In email@example.com, "Douglas Crockford" <douglas@...> wrote:
> > Is it valid ecmascript5 to switch from non-strict mode to strict mode within one file? That might happen by concatenating of a non-strict library and a "use strict" file. Worst case would be that future browser assume the whole file to be strict and thereby break the code.
> > I wondered because everybody is saying today "use as few files as possible or you and your site will be lame".
> The "use strict"; pragma is only meaningful at the first statement of a file or first statement of a function body. Anywhere else it is just a useless expression statement and is ignored.