fix(metadata): reset lastIndex of unix manual page regex before testing - #947
fix(metadata): reset lastIndex of unix manual page regex before testing#947btea wants to merge 1 commit into
lastIndex of unix manual page regex before testing#947Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@btea is attempting to deploy a commit to the OpenJS Foundation Team on Vercel. A member of the Team first needs to authorize it. |
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit 96d492e. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #947 +/- ##
=======================================
Coverage 86.21% 86.21%
=======================================
Files 195 195
Lines 17690 17692 +2
Branches 1609 1609
=======================================
+ Hits 15251 15253 +2
Misses 2433 2433
Partials 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
@nodejs/web-admins this shouldn't happen, we only want builds on |
The ignore step was already set to production only, I've now disabled the "Pull Request Comments" Git functionality, will see if that helps. |
QUERIES.unixManualPageis a global regex (/g), so itslastIndexpersists between calls.UNIST.isTextWithUnixManualuses.test()on this shared instance while visiting text nodes: after a successful match, the next.test()starts from the end of the previous match, intermittently returningfalsefor text that does contain a Unix manual page reference.This resets
lastIndexto 0 before each test so every node is matched from the start.https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test#:~:text=They%20store%20a%20lastIndex%20from%20the%20previous%20match.%20Using%20this%20internally%2C%20test()%20can%20be%20used%20to%20iterate%20over%20multiple%20matches%20in%20a%20string%20of%20text%20(with%20capture%20groups).