Fix TypeError in nouveau for stored index types#5952
Open
vamsi2246 wants to merge 2 commits intoapache:mainfrom
Open
Fix TypeError in nouveau for stored index types#5952vamsi2246 wants to merge 2 commits intoapache:mainfrom
vamsi2246 wants to merge 2 commits intoapache:mainfrom
Conversation
This PR fixes a string interpolation bug in nouveau.js where the raw data payload (value) was inadvertently concatenated into the runtime TypeError string when catching invalid 'stored' index types. Instead of evaluating to a confusing literal message or risking huge allocations, it now securely statically logs the parameter's variable name alongside typeof value.
f1263f5 to
90a2059
Compare
rnewson
reviewed
Mar 30, 2026
| var value = arguments[2]; | ||
| if (typeof value != 'number' && typeof value != 'string') { | ||
| throw ({ name: 'TypeError', message: 'type of ' + value + ' must be a string or number' }); | ||
| throw ({ name: 'TypeError', message: 'type of value must be a string or number not ' + typeof value }); |
Member
There was a problem hiding this comment.
good catch! I think we should include name in this string too, so that an error reads type of 'foo' must be a string or number not object for example. so name where value previous was but keep the typeof value at the end?
rnewson
requested changes
Mar 30, 2026
Member
|
Also, our pull request template is not optional. Please restore it and complete it honestly. |
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.
This PR fixes a string interpolation bug in nouveau.js where the raw data payload (value) was inadvertently concatenated into the runtime TypeError string when catching invalid 'stored' index types. Instead of evaluating to a confusing literal message or risking huge allocations, it now securely statically logs the parameter's variable name alongside typeof value.