Skip to content

Commit

Permalink
change execution order of brotli class
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Sep 12, 2024
1 parent 529390d commit b122dae
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 b122dae

Please # to comment.