JavaScript: return Float64Arrays rather than Arrays#539
Conversation
There was a problem hiding this comment.
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++
SedInstanceTaskto returnFloat64Arrayvia a newtoFloat64Arrayhelper function - Updated JavaScript tests to expect
Float64Arrayinstead ofArray - 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.
There was a problem hiding this comment.
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.
Fixes #538.