Skip to content

Commit 790615f

Browse files
authored
Merge pull request github#14552 from github/criemen/bazel-js
Javascript extractor: Bazel-based build
2 parents 06b1cd9 + 42c343e commit 790615f

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

javascript/extractor/BUILD.bazel

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
load("@//:common.bzl", "codeql_java_project")
2+
3+
codeql_java_project(
4+
name = "extractor",
5+
deps = [
6+
"@//extractor",
7+
"@//resources/lib/java:commons-compress",
8+
"@//resources/lib/java:gson",
9+
"@//resources/lib/java:jericho-html",
10+
"@//resources/lib/java:slf4j-api",
11+
"@//resources/lib/java:snakeyaml",
12+
"@//resources/lib/java/DO_NOT_DISTRIBUTE:junit",
13+
"@//third_party:jackson",
14+
"@//third_party:logback",
15+
"@//util-java7",
16+
"@//util-java8",
17+
],
18+
)

javascript/extractor/src/com/semmle/js/parser/JSONParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private char next() throws ParseError {
7979
}
8080

8181
private char peek() {
82-
return offset < length ? src.charAt(offset) : (char) -1;
82+
return offset < length ? src.charAt(offset) : Character.MAX_VALUE;
8383
}
8484

8585
private JSONValue readValue() throws ParseError {
@@ -356,7 +356,7 @@ private void skipLineComment() throws ParseError {
356356
char c;
357357
next();
358358
next();
359-
while ((c = peek()) != '\r' && c != '\n' && c != -1) next();
359+
while ((c = peek()) != '\r' && c != '\n' && c != Character.MAX_VALUE) next();
360360
}
361361

362362
/** Skips the block comment starting at the current position. */
@@ -367,7 +367,7 @@ private void skipBlockComment() throws ParseError {
367367
next();
368368
do {
369369
c = peek();
370-
if (c < 0) raise("Unterminated comment.");
370+
if (c == Character.MAX_VALUE) raise("Unterminated comment");
371371
next();
372372
if (c == '*' && peek() == '/') {
373373
next();

0 commit comments

Comments
 (0)