Skip to content

feat(api): align uint64 constructor and dump flags#745

Merged
buke merged 4 commits into
mainfrom
feat/uint64-dump-flags
May 22, 2026
Merged

feat(api): align uint64 constructor and dump flags#745
buke merged 4 commits into
mainfrom
feat/uint64-dump-flags

Conversation

@buke
Copy link
Copy Markdown
Owner

@buke buke commented May 22, 2026

  • add NewUint64 and the deprecated Uint64 alias for JavaScript Number values
  • export Go dump flag constants that mirror the quickjs-ng runtime flags
  • cover the new constructor and dump flag constants in focused context and runtime tests

- add NewUint64 and the deprecated Uint64 alias for JavaScript Number values
- export Go dump flag constants that mirror the quickjs-ng runtime flags
- cover the new constructor and dump flag constants in focused context and runtime tests
@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f04fc26) to head (b606674).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #745   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         3705      3711    +6     
=========================================
+ Hits          3705      3711    +6     
Files with missing lines Coverage Δ
context.go 100.00% <100.00%> (ø)
runtime.go 100.00% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f04fc26...b606674. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces NewUint64 and its deprecated alias Uint64 to the Context type, along with corresponding tests. It also exports a comprehensive set of DumpFlag constants in runtime.go to mirror the underlying QuickJS runtime flags. The reviewer suggested adding documentation comments to these new exported constants to improve discoverability and clarity for library users.

Comment thread runtime.go
- document that DumpFlag* values mirror quickjs-ng runtime dump flags
- note that the flags are combined with bitwise OR for Runtime.SetDumpFlags
- clarify that DumpFlagAbortOnLeaks is intended for testing
@buke
Copy link
Copy Markdown
Owner Author

buke commented May 22, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces NewUint64 and its deprecated alias Uint64 to the Context type, alongside a comprehensive set of DumpFlag constants for the Runtime. Feedback suggests implementing defensive checks for context validity in NewUint64 and enhancing documentation to warn about potential precision loss when mapping 64-bit integers to JavaScript Numbers.

Comment thread context.go Outdated
Comment thread context.go Outdated
- add a hasValidRef check before building a JavaScript Number from uint64
- document that NewUint64 and Uint64 return JavaScript Number values
- warn about precision loss beyond 2^53 - 1 and point callers to NewBigUint64
@buke
Copy link
Copy Markdown
Owner Author

buke commented May 22, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces NewUint64 and a deprecated Uint64 method to the Context struct, allowing the conversion of Go uint64 values to JavaScript Numbers. It also adds a comprehensive set of DumpFlag constants to the Runtime package, mirroring the quickjs-ng runtime dump flags. Corresponding tests have been added or updated to verify these new features. I have no feedback to provide.

- add nil-context coverage for NewUint64 in the existing libc helper guard test
- add closed-context coverage for NewUint64 in the same guard test
- keep the coverage fix isolated to the existing guard test surface
@buke buke merged commit c0c659d into main May 22, 2026
8 checks passed
@buke buke deleted the feat/uint64-dump-flags branch May 22, 2026 07:41
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