Skip to content

ffi: fix exportArrayBuffer type check - #66455

Open
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:ffi-exportarraybuffer-type-check
Open

trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:ffi-exportarraybuffer-type-check

Conversation

@trivikr

@trivikr trivikr commented Oct 2, 2026

Copy link
Copy Markdown
Member

Fixes: #66454

Use isArrayBuffer() instead of comparing Object.prototype.toString() output. The old check depended on Symbol.toStringTag, so a real ArrayBuffer with a custom tag was rejected, and a plain object tagged 'ArrayBuffer' passed and failed later in native code with a misleading error.


Assisted-by: claude:opus-5.5

Use isArrayBuffer() instead of comparing Object.prototype.toString()
output. The old check depended on Symbol.toStringTag, so a real
ArrayBuffer with a custom tag was rejected, and a plain object tagged
'ArrayBuffer' passed and failed later in native code with a misleading
error.

Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
Assisted-by: claude:opus-5.5
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/ffi

@nodejs-github-bot nodejs-github-bot added ffi Issues and PRs related to experimental Foreign Function Interface support. needs-ci PRs that need a full CI run. labels Oct 2, 2026
@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 2, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 2, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@codecov

codecov Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.41%. Comparing base (a7a9784) to head (e6bf923).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #66455      +/-   ##
==========================================
- Coverage   92.78%   90.41%   -2.38%     
==========================================
  Files         422      791     +369     
  Lines      192812   275598   +82786     
  Branches    29706    52835   +23129     
==========================================
+ Hits       178900   249179   +70279     
- Misses      13588    16821    +3233     
- Partials      324     9598    +9274     
Files with missing lines Coverage Δ
lib/ffi.js 96.37% <100.00%> (+42.27%) ⬆️

... and 499 files with indirect coverage changes

🚀 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.

@addaleax addaleax added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Oct 2, 2026
@github-actions github-actions Bot added request-ci-failed Starting CI with the request-ci label failed and requires manual intervention. and removed request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Failed to start CI

   ℹ  Existing CI run found: https://ci.nodejs.org/job/node-test-pull-request/78132/
   ✖  Refusing to start a potentially duplicate CI job. CI has already succeeded for this commit.
Full Auto Start CI output
�[36m⠋�[39m Getting reviews from nodejs/node/pull/66455
�[36m⠋�[39m Getting commits from nodejs/node/pull/66455
�[36m⠙�[39m Validating Jenkins credentials
�[36m⠙�[39m Validating Jenkins credentials
✔  Jenkins credentials valid
�[36m⠹�[39m Getting comments from nodejs/node/pull/66455
�[36m⠸�[39m Querying data for job/node-test-pull-request/78132/
�[36m⠸�[39m Querying data for job/node-test-pull-request/78132/
�[36m⠸�[39m Querying API for job/node-test-pull-request/78132/
✔  Build data downloaded
   ℹ  Existing CI run found: https://ci.nodejs.org/job/node-test-pull-request/78132/
   ✖  Refusing to start a potentially duplicate CI job. CI has already succeeded for this commit.

View workflow run

@trivikr trivikr added commit-queue PRs queued for automated landing through the Commit Queue. and removed request-ci-failed Starting CI with the request-ci label failed and requires manual intervention. labels Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue PRs queued for automated landing through the Commit Queue. ffi Issues and PRs related to experimental Foreign Function Interface support. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ffi: exportArrayBuffer type check is fooled by Symbol.toStringTag

5 participants