Skip to content

fix: use errstr() instead of toSource() in nouveau handleIndexError for QuickJS compatibility#5951

Open
vamsi2246 wants to merge 2 commits intoapache:mainfrom
vamsi2246:fix/nouveau-tosource-quickjs-compat
Open

fix: use errstr() instead of toSource() in nouveau handleIndexError for QuickJS compatibility#5951
vamsi2246 wants to merge 2 commits intoapache:mainfrom
vamsi2246:fix/nouveau-tosource-quickjs-compat

Conversation

@vamsi2246
Copy link
Copy Markdown

Overview

handleIndexError() in nouveau.js calls err.toSource(), which is a SpiderMonkey-specific method not available in QuickJS. This causes the error handler itself to crash when a Nouveau index function throws a non-fatal error on QuickJS-based deployments.

This replaces err.toSource() with the existing errstr() helper (defined in util.js), which safely checks for toSource availability before calling it, falling back to toString(). This is consistent with the identical pattern used in dreyfus.js and views.js.

Testing recommendations

N/A - This is a trivial 1-line compatibility fix that aligns nouveau.js with the existing pattern in dreyfus.js.

vamsi and others added 2 commits March 29, 2026 00:53
Replace SpiderMonkey-specific err.toSource() with the cross-engine
errstr() helper in nouveau.js handleIndexError(). The errstr() function
(defined in util.js) safely checks for toSource availability before
calling it, falling back to toString(). This is consistent with the
identical pattern used in dreyfus.js handleIndexError().

Without this fix, any non-fatal error thrown by a Nouveau index function
on QuickJS causes the error handler itself to crash with a TypeError,
preventing graceful error logging and document skipping.
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