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

Reserved property name

Expand Messages
  • Douglas Crockford
    JSLint counts all of the occurrences of property names for its /*members*/ report. It does that by making an object with a property for each name that it sees.
    Message 1 of 1 , Sep 20, 2009
    • 0 Attachment
      JSLint counts all of the occurrences of property names for its
      /*members*/ report. It does that by making an object with a
      property for each name that it sees. The value of each property
      is its count.

      Running JSLint on this script caused it to fail only on Firefox:

      Field.prototype.__iterator__ = function Field___iterator__ () {
      return new FieldIter(this);
      };

      Firefox has a non-standard feature that causes for..in to fail
      if an object has an __iterator__ property that is not a function.
      These experimental extensions are a hazard to reliability and
      portability.

      So JSLint now issues a reserved property name warning when it sees
      such names, and excludes them from the /*members*/ report.
    Your message has been successfully submitted and would be delivered to recipients shortly.