Skip to content

feat: add Int64 support - #13674

Merged
kgryte merged 14 commits into
stdlib-js:developfrom
impawstarlight:feature/int64-doctest
Jul 27, 2026
Merged

feat: add Int64 support#13674
kgryte merged 14 commits into
stdlib-js:developfrom
impawstarlight:feature/int64-doctest

Conversation

@impawstarlight

Copy link
Copy Markdown
Contributor

Resolves none.

Description

What is the purpose of this pull request?

This pull request:

  • Adds doctesting support for 64-bit signed integers (Int64)

Related Issues

Does this pull request have any related issues?

No.

Questions

Any questions for reviewers of this pull request?

  • There are some issues regarding weird response messages from compareValues that needs further review. I marked them with TODO comments in the test files.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

N/A.


@stdlib-js/reviewers

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown_pkg_readmes
    status: na
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@impawstarlight
impawstarlight requested a review from a team July 26, 2026 21:43
@stdlib-bot stdlib-bot added Tools Issue or pull request related to project tooling. Needs Review A pull request which needs code review. labels Jul 26, 2026
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Jul 27, 2026
Comment thread lib/node_modules/@stdlib/_tools/doctest/compare-values/lib/main.js Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/_tools/doctest/compare-values/test/test.js Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/_tools/doctest/compare-values/test/test.js Outdated
Comment thread lib/node_modules/@stdlib/_tools/doctest/compare-values/test/test.js Outdated
Comment thread lib/node_modules/@stdlib/_tools/doctest/compare-values/test/test.js Outdated
Comment thread lib/node_modules/@stdlib/_tools/doctest/compare-values/test/test.js Outdated
Comment thread lib/node_modules/@stdlib/_tools/doctest/compare-values/test/test.js Outdated
Comment thread lib/node_modules/@stdlib/_tools/doctest/compare-values/test/test.js Outdated
actual = new Uint64( 1234 );
expected = '<Uint64>';
t.strictEqual( compareValues( actual, expected ), null, 'returns expected value' );
if ( HAS_BIGINTS ) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You moved everything under a big int check. Why is this necessary now if it wasn't before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because they do need BigInt support to correctly work. createAnnotation converts Uint64 to BigInt and compareValues parses BigInt from annotated entries. I just forgot to add the guard in my earlier work.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not any more. I added support in createAnnotation for environments in which the primitive value is serialized to a number, not a BigInt. You just needed to add a small if clause.

@impawstarlight impawstarlight Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in those cases, the annotation should look like <Int64> [ '1234' ]?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I don't believe so. I believe I normalized it so that an n is always appended. The key being #.valueOf. In older envs, it returns a number. That gets serialized to 1234. We append an n.

Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/_tools/doctest/compare-values/test/test.js Outdated
Comment thread lib/node_modules/@stdlib/_tools/doctest/compare-values/test/test.js Outdated
kgryte added 2 commits July 26, 2026 21:27
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/_tools/doctest/create-annotation-value/lib/main.js Outdated
Comment thread lib/node_modules/@stdlib/_tools/doctest/create-annotation-value/lib/main.js Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
kgryte added 3 commits July 26, 2026 21:36
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/_tools/doctest/create-annotation-value/test/test.js Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/_tools/doctest/create-annotation-value/lib/main.js Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/_tools/doctest/create-annotation-value/lib/main.js Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>

@kgryte kgryte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after clean-up.

@kgryte kgryte changed the title feat: add doctesting support for Int64 feat: add Int64 support Jul 27, 2026
@kgryte
kgryte merged commit d8193fb into stdlib-js:develop Jul 27, 2026
9 checks passed
@impawstarlight
impawstarlight deleted the feature/int64-doctest branch July 27, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tools Issue or pull request related to project tooling.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants