Loading ...
Sorry, an error occurred while loading the content.

1681Re: [jslint] option.strict

Expand Messages
  • Douglas Crockford
    Dec 13, 2010
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, AJ ONeal <coolaj86@...> wrote:
      >
      > Iis this assumption correct?
      >
      > // begin myfile.js:
      > "use strict";
      > (function () {
      > // this function is in strict mode
      > var nullthing = this;
      > }());
      > (function () {
      > // this function is not in strict mode

      Wrong. All functions in this file are strict. Also, if you concatenate any programs to the end of this file, they will be strict, too.

      > var globalObj = this;
      > }());
      > // end myfile.js
      >
      >
      >
      > or should I do something like this?
      >
      > (function () {
      > "use strict";
      > (function () {
      > }());
      > }());

      This is better. Both functions are strict.
    • Show all 9 messages in this topic