Skip to content

fix: preserve input dimensions in ones and zeros - #3718

Open
sergioperezcheco wants to merge 1 commit into
josdejong:developfrom
sergioperezcheco:fix/preserve-constructor-dimensions
Open

sergioperezcheco wants to merge 1 commit into
josdejong:developfrom
sergioperezcheco:fix/preserve-constructor-dimensions

Conversation

@sergioperezcheco

Copy link
Copy Markdown

ones and zeros normalize BigNumber dimensions in place, replacing entries in the caller's array with numbers. Reusing that array consequently changes the generated element type on the second call, and frozen BigNumber dimensions throw even though they are otherwise valid. Copy the dimensions before normalization in both constructors, preserving their existing validation and storage behavior.

The regression tests cover repeated calls, frozen arrays, dense/sparse storage and validation failures. Local build-and-test, lint, TypeScript checks, coverage and FirefoxHeadless passed; public CJS/ESM/UMD checks also passed. Node 20/24 and the remote browser matrix were not run locally.

From Tool: Hermes Agent; assisted implementation and independently checked regression behavior.

Assisted-by: Hermes Agent
Signed-off-by: sergioperezcheco <checo520@outlook.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant