Repository navigation
Conversation
`[name *= value]`, `[name ^= value]` and `[name $= value]` threw a TypeError when the value was a number and the data field was not a string (e.g. a numeric, boolean or missing field), because the string forms of the field and value were never computed. Always compare string representations for the substring operators, as the case-insensitive variants already do.
|
No actionable comments were generated in the recent review. ℹ️ Recent review info
Walkthrough
Merge Risk:
|
|
Very good. Thanks |
Cross-references to related issues. If there is no existing issue that describes your bug or feature request, then create an issue before making your pull request.
Associated issues:
Notes re. the content of the pull request. Give context to reviewers or serve as a general record of the changes made. Add a screenshot or video to demonstrate your new feature, if possible.
cy.$('[weight ^= 1]')throwsTypeError: Cannot read properties of undefined (reading 'indexOf')when any element'sweightis a number, a boolean or missing. The same goes for*=and$=with a number value, including in stylesheet selectors.valCmp()(src/selector/data.mjs), the string forms of the field and value were only built when one of them was a string or the comparison was case-insensitive. The substring operators always need those strings, so comparing a number with a number calledundefined.indexOf().*=,^=and$=, including their!and@variants. That matches what[weight @^= 1]already did.=,!=,<,>and the other operators are unchanged.*=,^=,$=and!*=with numeric values, plus one with a non-string field. They fail with the TypeError before the fix and pass after it.npm run test:jsgives 764 passing andnpm run test:modulesgives 46 passing.Checklist
Author:
unstable. Bug-fix patches can go on eitherunstableormaster.index.d.tsTypescript definition file has been appropriately updated. (No API change.)Reviewers:
masterbranch and theunstablebranch. Normally, this just requires cherry-picking the corresponding merge commit frommastertounstable-- or vice versa.Summary by CodeRabbit
Bug Fixes
Tests