Skip to content

Commit

Permalink
Merge pull request #2701 from cloudflare/yagiz/regression-test-for-cr…
Browse files Browse the repository at this point in the history
…eatebrotli

fix the execution order of brotli class
  • Loading branch information
anonrig authored Sep 12, 2024
2 parents 529390d + b122dae commit b4d69b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/node/internal/internal_zlib_base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,6 @@ export class Brotli extends ZlibBase {
: new zlibUtil.BrotliEncoder(mode);

const _writeState = new Uint32Array(2);
super(options ?? {}, mode, handle, brotliDefaultOptions);
this._writeState = _writeState;

// TODO(addaleax): Sometimes we generate better error codes in C++ land,
// e.g. ERR_BROTLI_PARAM_SET_FAILED -- it's hard to access them with
Expand All @@ -762,5 +760,8 @@ export class Brotli extends ZlibBase {
) {
throw new ERR_ZLIB_INITIALIZATION_FAILED();
}

super(options ?? {}, mode, handle, brotliDefaultOptions);
this._writeState = _writeState;
}
}

0 comments on commit b4d69b5

Please # to comment.