fix: use errstr() instead of toSource() in nouveau handleIndexError for QuickJS compatibility#5951
Open
vamsi2246 wants to merge 2 commits intoapache:mainfrom
Open
fix: use errstr() instead of toSource() in nouveau handleIndexError for QuickJS compatibility#5951vamsi2246 wants to merge 2 commits intoapache:mainfrom
vamsi2246 wants to merge 2 commits intoapache:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
handleIndexError()innouveau.jscallserr.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 existingerrstr()helper (defined inutil.js), which safely checks fortoSourceavailability before calling it, falling back totoString(). This is consistent with the identical pattern used indreyfus.jsandviews.js.Testing recommendations
N/A - This is a trivial 1-line compatibility fix that aligns
nouveau.jswith the existing pattern indreyfus.js.