pakmanaged.js
function(checks) {
        var allowNewLine = false;
        var jump = 1;
        this.skip();
        var char = this.peek();
    
        switch (char) {
        case "'":
          this.triggerAsync("warning", {
            code: "W114",
            line: this.line,
            character: this.char,
            data: [ "\\'" ]
          }, checks, function() {return state.jsonMode; });
          break;
        case "b":
          char = "\\b";
          break;
        case "f":
          char = "\\f";
          break;
        case "n":
          char = "\\n";
          break;
        case "r":
          char = "\\r";
          break;
        case "t":
          char = "\\t";
          break;
        case "0":
          char = "\\0";
    
          // Octal literals fail in strict mode.
          // Check if the number is between 00 and 07.
          var n = parseInt(this.peek(1), 10);
          this.triggerAsync("warning", {
            code: "W115",
            line: this.line,
            character: this.char
          }, checks,
          function() { return n >= 0 && n <= 7 && state.isStrict(); });
          break;
        case "u":
          var hexCode = this.input.substr(1, 4);
          var code = parseInt(hexCode, 16);
          if (isNaN(code)) {
            this.trigger("warning", {
              code: "W052",
              line: this.line,
              character: this.char,
              data: [ "u" + hexCode ]
            });
          }
          char = String.fromCharCode(code);
          jump = 5;
          break;
        case "v":
          this.triggerAsync("warning", {
            code: "W114",
            line: this.line,
            character: this.char,
            data: [ "\\v" ]
          }, checks, function() { return state.jsonMode; });
    
          char = "\v";
          break;
        case "x":
          var  x = parseInt(this.input.substr(1, 2), 16);
    
          this.triggerAsync("warning", {
            code: "W114",
            line: this.line,
            character: this.char,
            data: [ "\\x-" ]
          }, checks, function() { return state.jsonMode; });
    
          char = String.fromCharCode(x);
          jump = 3;
          break;
        case "\\":
          char = "\\\\";
          break;
        case "\"":
          char = "\\\"";
          break;
        case "/":
          break;
        case "":
          allowNewLine = true;
          char = "";
          break;
        }
    
        return { char: char, jump: jump, allowNewLine: allowNewLine };
      }
function(checks) {
        var allowNewLine = false;
        var jump = 1;
        this.skip();
        var char = this.peek();
    
        switch (char) {
        case "'":
          this.triggerAsync("warning", {
            code: "W114",
            line: this.line,
            character: this.char,
            data: [ "\\'" ]
          }, checks, function() {return state.jsonMode; });
          break;
        case "b":
          char = "\\b";
          break;
        case "f":
          char = "\\f";
          break;
        case "n":
          char = "\\n";
          break;
        case "r":
          char = "\\r";
          break;
        case "t":
          char = "\\t";
          break;
        case "0":
          char = "\\0";
    
          // Octal literals fail in strict mode.
          // Check if the number is between 00 and 07.
          var n = parseInt(this.peek(1), 10);
          this.triggerAsync("warning", {
            code: "W115",
            line: this.line,
            character: this.char
          }, checks,
          function() { return n >= 0 && n <= 7 && state.isStrict(); });
          break;
        case "u":
          var hexCode = this.input.substr(1, 4);
          var code = parseInt(hexCode, 16);
          if (isNaN(code)) {
            this.trigger("warning", {
              code: "W052",
              line: this.line,
              character: this.char,
              data: [ "u" + hexCode ]
            });
          }
          char = String.fromCharCode(code);
          jump = 5;
          break;
        case "v":
          this.triggerAsync("warning", {
            code: "W114",
            line: this.line,
            character: this.char,
            data: [ "\\v" ]
          }, checks, function() { return state.jsonMode; });
    
          char = "\v";
          break;
        case "x":
          var  x = parseInt(this.input.substr(1, 2), 16);
    
          this.triggerAsync("warning", {
            code: "W114",
            line: this.line,
            character: this.char,
            data: [ "\\x-" ]
          }, checks, function() { return state.jsonMode; });
    
          char = String.fromCharCode(x);
          jump = 3;
          break;
        case "\\":
          char = "\\\\";
          break;
        case "\"":
          char = "\\\"";
          break;
        case "/":
          break;
        case "":
          allowNewLine = true;
          char = "";
          break;
        }
    
        return { char: char, jump: jump, allowNewLine: allowNewLine };
      }
function ( checks ) { var allowNewLine = false ; var jump = 1 ; this . skip ( ) ; var char = this . peek ( ) ; switch ( char ) { case "'" : this . triggerAsync ( "warning" , { code : "W114" , line : this . line , character : this . char , data : [ "\\'" ] } , checks , function ( ) { return state . jsonMode ; } ) ; break ; case "b" : char = "\\b" ; break ; case "f" : char = "\\f" ; break ; case "n" : char = "\\n" ; break ; case "r" : char = "\\r" ; break ; case "t" : char = "\\t" ; break ; case "0" : char = "\\0" ; // Octal literals fail in strict mode. // Check if the number is between 00 and 07. var n = parseInt ( this . peek ( 1 ) , 10 ) ; this . triggerAsync ( "warning" , { code : "W115" , line : this . line , character : this . char } , checks , function ( ) { return n >= 0 && n <= 7 && state . isStrict ( ) ; } ) ; break ; case "u" : var hexCode = this . input . substr ( 1 , 4 ) ; var code = parseInt ( hexCode , 16 ) ; if ( isNaN ( code ) ) { this . trigger ( "warning" , { code : "W052" , line : this . line , character : this . char , data : [ "u" + hexCode ] } ) ; } char = String . fromCharCode ( code ) ; jump = 5 ; break ; case "v" : this . triggerAsync ( "warning" , { code : "W114" , line : this . line , character : this . char , data : [ "\\v" ] } , checks , function ( ) { return state . jsonMode ; } ) ; char = "\v" ; break ; case "x" : var x = parseInt ( this . input . substr ( 1 , 2 ) , 16 ) ; this . triggerAsync ( "warning" , { code : "W114" , line : this . line , character : this . char , data : [ "\\x-" ] } , checks , function ( ) { return state . jsonMode ; } ) ; char = String . fromCharCode ( x ) ; jump = 3 ; break ; case "\\" : char = "\\\\" ; break ; case "\"" : char = "\\\"" ; break ; case "/" : break ; case "" : allowNewLine = true ; char = "" ; break ; } return { char : char , jump : jump , allowNewLine : allowNewLine } ; }
Assumes previously parsed character was \ (=== '\\') and was not skipped.
Assumes previously parsed character was \ ( === \\ ) and was not skipped .