Skip to content

Commit

Permalink
Replace TS strict_checks with source-level suppressions.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 555445920
  • Loading branch information
eustas authored and Copybara-Service committed Aug 10, 2023
1 parent 8c79230 commit 9ff341d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
10 changes: 6 additions & 4 deletions java/org/brotli/dec/Decode.java
Original file line number Diff line number Diff line change
Expand Up @@ -1109,8 +1109,8 @@ static void decompress(State s) {
case COMPRESSED_BLOCK_START:
readMetablockHuffmanCodesAndContextMaps(s);
s.runningState = MAIN_LOOP;
// Fall through

// fall through
case MAIN_LOOP:
if (s.metaBlockLength <= 0) {
s.runningState = BLOCK_START;
Expand Down Expand Up @@ -1141,7 +1141,7 @@ static void decompress(State s) {
s.j = 0;
s.runningState = INSERT_LOOP;

// Fall through
// fall through
case INSERT_LOOP:
if (s.trivialLiteralContext != 0) {
while (s.j < s.insertLength) {
Expand Down Expand Up @@ -1248,7 +1248,8 @@ static void decompress(State s) {
}
s.j = 0;
s.runningState = COPY_LOOP;
// fall through

// fall through
case COPY_LOOP:
int src = (s.pos - s.distance) & ringBufferMask;
int dst = s.pos;
Expand Down Expand Up @@ -1320,7 +1321,8 @@ static void decompress(State s) {
case INIT_WRITE:
s.ringBufferBytesReady = Math.min(s.pos, s.ringBufferSize);
s.runningState = WRITE;
// fall through

// fall through
case WRITE:
if (writeRingBuffer(s) == 0) {
// Output buffer is full.
Expand Down
12 changes: 12 additions & 0 deletions js/decode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -886,9 +886,15 @@ function decompress(s: State): void {
ringBufferMask = s.ringBufferSize - 1;
ringBuffer = s.ringBuffer;
continue;
// Fallthrough case in switch is intentional.
// tslint:disable-next-line:ban-ts-suppressions
// @ts-ignore error TS7029: Fallthrough case in switch.
case 3:
readMetablockHuffmanCodesAndContextMaps(s);
s.runningState = 4;
// Fallthrough case in switch is intentional.
// tslint:disable-next-line:ban-ts-suppressions
// @ts-ignore error TS7029: Fallthrough case in switch.
case 4:
if (s.metaBlockLength <= 0) {
s.runningState = 2;
Expand Down Expand Up @@ -924,6 +930,9 @@ function decompress(s: State): void {
s.copyLength = copyLengthOffset + ((copyLengthExtraBits <= 16) ? readFewBits(s, copyLengthExtraBits) : readManyBits(s, copyLengthExtraBits));
s.j = 0;
s.runningState = 7;
// Fallthrough case in switch is intentional.
// tslint:disable-next-line:ban-ts-suppressions
// @ts-ignore error TS7029: Fallthrough case in switch.
case 7:
if (s.trivialLiteralContext !== 0) {
while (s.j < s.insertLength) {
Expand Down Expand Up @@ -1106,6 +1115,9 @@ function decompress(s: State): void {
case 6:
copyUncompressedData(s);
continue;
// Fallthrough case in switch is intentional.
// tslint:disable-next-line:ban-ts-suppressions
// @ts-ignore error TS7029: Fallthrough case in switch.
case 12:
s.ringBufferBytesReady = Math.min(s.pos, s.ringBufferSize);
s.runningState = 13;
Expand Down

0 comments on commit 9ff341d

Please sign in to comment.