Skip to content

Commit 1c1ae11

Browse files
committed
JS-1354 align standalone parser with parsingErrors array
# Conflicts: # sonar-plugin/standalone/src/main/java/org/sonar/plugins/javascript/standalone/StandaloneParser.java
1 parent d680a64 commit 1c1ae11

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sonar-plugin/standalone/src/main/java/org/sonar/plugins/javascript/standalone/StandaloneParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ public ESTree.Program parse(String code, String filename) {
178178
var result = toSingleFileResponse(output, filePath);
179179
Node ast = result.ast();
180180
if (ast == null) {
181-
var parsingError = result.parsingError();
181+
var parsingErrors = result.parsingErrors();
182182
var message =
183-
parsingError != null && parsingError.message() != null
183+
!parsingErrors.isEmpty() && parsingErrors.get(0).message() != null
184184
? String.format(
185185
"Failed to parse the code: [%s] in [%s]",
186-
parsingError.message(),
186+
parsingErrors.get(0).message(),
187187
filename
188188
)
189189
: "Failed to parse the code";

0 commit comments

Comments
 (0)