Skip to content

fix: regexp needs to reset lastIndex each time test is called#320

Merged
sxzz merged 1 commit intorolldown:mainfrom
btea:fix/external-plugin-regexp-reset-lastIndex
Jun 13, 2025
Merged

fix: regexp needs to reset lastIndex each time test is called#320
sxzz merged 1 commit intorolldown:mainfrom
btea:fix/external-plugin-regexp-reset-lastIndex

Conversation

@btea
Copy link
Contributor

@btea btea commented Jun 13, 2025

Description

If the regular expression passed in carries the g modifier, multiple tests may produce unexpected results.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test

Linked Issues

Additional context

@netlify
Copy link

netlify bot commented Jun 13, 2025

Deploy Preview for tsdown ready!

Name Link
🔨 Latest commit bb0d98f
🔍 Latest deploy log https://app.netlify.com/projects/tsdown/deploys/684b7b2d13f93000084eb515
😎 Deploy Preview https://deploy-preview-320--tsdown.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jun 13, 2025

Open in StackBlitz

npm i https://pkg.pr.new/tsdown@320

commit: bb0d98f

@sxzz sxzz merged commit 1abc97b into rolldown:main Jun 13, 2025
15 checks passed
@btea btea deleted the fix/external-plugin-regexp-reset-lastIndex branch June 13, 2025 05:16
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.

2 participants