File tree Expand file tree Collapse file tree 4 files changed +22
-16
lines changed
Tasks/AzureResourceGroupDeployment Expand file tree Collapse file tree 4 files changed +22
-16
lines changed Original file line number Diff line number Diff line change 11{
2- //This json file has comments
2+ // This json file has comments
3+ "var" : " value ending with escaped character\\\"\\\\ "
4+ /*some Comment After the escaped Character */
35}
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ function stripJsonComments(content) {
3939
4040 var currentChar ;
4141 var nextChar ;
42- var prevChar ;
4342 var insideQuotes = false ;
4443 var contentWithoutComments = '' ;
4544 var insideComment = 0 ;
@@ -65,21 +64,26 @@ function stripJsonComments(content) {
6564 }
6665
6766 } else {
68- prevChar = i - 1 >= 0 ? content [ i - 1 ] : "" ;
69-
70- if ( currentChar == '"' && prevChar != '\\' ) {
71- insideQuotes = ! insideQuotes
67+ if ( insideQuotes && currentChar == "\\" ) {
68+ contentWithoutComments += currentChar + nextChar ;
69+ i ++ ; // Skipping checks for next char if escaped
70+ continue ;
7271 }
73-
74- if ( ! insideQuotes ) {
75- if ( currentChar + nextChar === '//' ) {
76- insideComment = singlelineComment ;
77- i ++ ;
72+ else {
73+ if ( currentChar == '"' ) {
74+ insideQuotes = ! insideQuotes ;
7875 }
7976
80- if ( currentChar + nextChar === '/*' ) {
81- insideComment = multilineComment ;
82- i ++ ;
77+ if ( ! insideQuotes ) {
78+ if ( currentChar + nextChar === '//' ) {
79+ insideComment = singlelineComment ;
80+ i ++ ;
81+ }
82+
83+ if ( currentChar + nextChar === '/*' ) {
84+ insideComment = multilineComment ;
85+ i ++ ;
86+ }
8387 }
8488 }
8589 }
Original file line number Diff line number Diff line change 1414 "version" : {
1515 "Major" : 2 ,
1616 "Minor" : 2 ,
17- "Patch" : 16
17+ "Patch" : 17
1818 },
1919 "demands" : [],
2020 "minimumAgentVersion" : " 2.119.1" ,
Original file line number Diff line number Diff line change 1414 "version" : {
1515 "Major" : 2 ,
1616 "Minor" : 2 ,
17- "Patch" : 16
17+ "Patch" : 17
1818 },
1919 "demands" : [],
2020 "minimumAgentVersion" : " 2.119.1" ,
You can’t perform that action at this time.
0 commit comments