Repository navigation
fix(util): implement native inherits - #3892
Merged
proggeramlug merged 1 commit intoJun 1, 2026
Merged
proggeramlug merged 1 commit into
proggeramlug merged 1 commit into
Conversation
Wire util.inherits through the native dispatch and direct codegen paths so it sets the prototype chain, exposes non-enumerable super_, and preserves instanceof behavior for synthetic function classes. Also preserve closure property attributes for dynamic function properties and keep util.debuglog logger.name non-enumerable. Closes PerryTS#2673. Closes PerryTS#3885. Refs PerryTS#2514.
This was referenced May 31, 2026
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.
Summary
util.inheritsthrough native module dispatch and direct native-codegen lowering.ctor.super_, and synthetic function-class parent registration so directnode:utilimports behave like Node.util.debuglog()loggernameproperty.Issue Cluster
Closes #2673.
Closes #3885.
Refs #2514.
These issues share the
node:utilnative export path and closure/function descriptor behavior, so batching them keeps the runtime and parity coverage coherent.Tests Added
test-parity/node-suite/util/inherits/basic.tstest-parity/node-suite/util/inherits/validation.tstest-parity/node-suite/util/debuglog/basic.tsfor the loggernamedescriptor.Verification
npx -y node@25.9.0 --experimental-strip-types test-parity/node-suite/util/inherits/basic.tsnpx -y node@25.9.0 --experimental-strip-types test-parity/node-suite/util/inherits/validation.tsnpx -y node@25.9.0 --experimental-strip-types test-parity/node-suite/util/debuglog/basic.tsPATH=/tmp/perry-node25-bin:$PATH ./run_parity_tests.sh --suite node-suite --module util --filter util/inheritsPATH=/tmp/perry-node25-bin:$PATH ./run_parity_tests.sh --suite node-suite --module util --filter util/debuglog/basicPATH=/tmp/perry-node25-bin:$PATH ./run_parity_tests.sh --suite node-suite --module utilcargo check -p perry-runtime --quietcargo fmt --all -- --checkgit diff --check./scripts/check_file_size.shjq empty test-parity/known_failures.jsoncargo build --release --quiet -p perry -p perry-runtime -p perry-stdlibKnown Limitations / Non-Goals
node:streaminheritance or anynode:streamcompose behavior.