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

2916Error in whitespace algorithm (UNCLASSIFIED)

Expand Messages
  • Cheney, Edward A SFC RES USAR USARC
    Jul 4, 2012
      Classification: UNCLASSIFIED
      This following pattern is what passes in JSLint:

      var o = function () {
      ........"use strict";
      ........var x = {
      ................large: 0,
      ................css: {
      ....................body: "botyu"
      ................},
      ................top: "",
      ................color: "default"
      ............},
      ............p = ["wer", "asdf", {
      ................v: "df",
      ................r: "sdf"
      ............}, "rwer", "tyu", {
      ................q: "yh"
      ............}
      ................];
      ....};

      The correct pattern, in keeping with the spirit of JSLint, is:

      var o = function () {
      ........"use strict";
      ........var x = {
      ................large: 0,
      ................css: {
      ....................body: "botyu"
      ................},
      ................top: "",
      ................color: "default"
      ............},
      ............p = ["wer", "asdf", {
      ........................v: "df",
      ........................r: "sdf"
      ....................}, "rwer", "tyu", {
      ........................q: "yh"
      ....................}];
      ....};

      The difference is in variable p. A child dimension should be indented in addition to that of its parent. If there are no indexes separating syntax characters of containment then those syntax characters can be collapsed upon each other without separating white space.

      My own application currently fails this pattern as well.

      Classification: UNCLASSIFIED
    • Show all 2 messages in this topic