Repository navigation
hotfix: remove unresolved conflict markers from #3818/#3829 merges - #3863
Merged
Merged
Conversation
Admin-merges of #3818 and #3829 landed nested git conflict markers in four files, leaving main uncompilable. Restore those files to their last marker-free state (93425ba, #3823). #3855/#3856/#3858 did not touch them. The node-compat surface from #3818 (crypto legacy) and #3829 (constants.default alias) is reverted on these files and needs redoing from clean branches; the original fork branches carry committed markers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3285
Implementation
zlibdeflate-family streams exposestream.params(level, strategy, cb). Perry previously treated it as a no-op callback shim (zlib_stream_paramsin perry-stdlib), so it neither validated arguments nor changed compression behavior. Because the well-known binding routesnode:zlibtoperry-ext-zlib(and strips the bundledcompressionfeature), the observable path lives inperry-ext-zlib, which had noparamsdispatch arm at all (it fell through toundefined).node_submodules/zlib.rs): newjs_zlib_validate_params(level, strategy) -> i32helper, a sibling of the existingjs_zlib_resolve_level. It validates the args exactly like Node — non-numericlevel/strategythrowsTypeError [ERR_INVALID_ARG_TYPE],leveloutside-1..=9orstrategyoutside0..=4throwsRangeError [ERR_OUT_OF_RANGE](level validated first) — and returns the clamped flate2 level (Z_DEFAULT_COMPRESSION/-1→ default6). The ext crate can't reach Perry's numeric typing or thejs_throwmachinery, so it calls back here (same pattern as#2935). Added a#[used]keepalive anchor so auto-optimize's whole-program bitcode rebuild doesn't dead-strip the codegen/ext-only symbol.stream.rs): newparamsdispatch arm +stream_params(). It validates first (the validate call mayjs_throw/longjmp, so it must run before taking the registry lock to avoid poisoning the mutex), then retunes by rebuilding the deflate-family encoder at the new level when no data has been written yet (the common case —params()before the firstwrite), since flate2 exposes no mid-streamdeflateParams. After data is written it validates + flushes only. The callback is queued and fired by the existing pump. Also extractedmake_codec_state_with_level()and wired the initialcreateDeflate({ level })option through it (previously the factory ignored_opts), and added awrote_dataflag.paramswas already in the routed-method allowlist inperry-stdlib's dispatch, so no dispatch wiring change was needed.No new HIR variant. No manifest/API surface change (both FFIs are internal symbols), so no docs regen.
Validation
test-files/test_gap_zlib_3285_params.ts— byte-identical tonode --experimental-strip-typesunder the DEFAULT auto-optimize compile:params(0, …)andparams(9, …)produce different valid deflate output for a 32768-byte repeated input (level 0 > level 9), bothinflateSyncround-trip back to 32768 bytes, the success callback fires, and invalidlevel/strategy/type throw Node-compatible errors synchronously.cargo fmt --all -- --checkclean,./scripts/check_file_size.shexit 0,cargo test --release -p perry-ext-zlib -p perry-hirall green.