Skip to content

JavaScript: return Float64Arrays rather than Arrays#539

Merged
agarny merged 3 commits intoopencor:mainfrom
agarny:issue538
Feb 26, 2026
Merged

JavaScript: return Float64Arrays rather than Arrays#539
agarny merged 3 commits intoopencor:mainfrom
agarny:issue538

Conversation

@agarny
Copy link
Contributor

@agarny agarny commented Feb 26, 2026

Fixes #538.

Copilot AI review requested due to automatic review settings February 26, 2026 05:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request aims to improve JavaScript binding performance by returning Float64Arrays instead of regular JavaScript Arrays from C++ methods that provide numerical data. The change affects the SED instance task interface where various data arrays (VOI, states, rates, constants, computed constants, and algebraic variables) are returned to JavaScript code. However, the implementation has a critical memory safety bug.

Changes:

  • Modified C++ SedInstanceTask to return Float64Array via a new toFloat64Array helper function
  • Updated JavaScript tests to expect Float64Array instead of Array
  • Version bump from 0.20260211.0 to 0.20260226.0

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/sed/sedinstancetask.cpp Implemented toFloat64Array helper and updated all *AsArray() methods to use it
tests/bindings/javascript/sed.coverage.test.js Updated test assertions to compare against emptyFloat64Array instead of empty arrays
tests/bindings/javascript/res/index.html Minor HTML formatting changes (whitespace cleanup)
VERSION.txt Version bump to 0.20260226.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@agarny agarny merged commit a570b21 into opencor:main Feb 26, 2026
28 checks passed
@agarny agarny deleted the issue538 branch February 26, 2026 06:03
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.

JavaScript: return Float64Arrays rather than Arrays

2 participants