Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plugin/replace): prevent assignment #2093

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

ikkz
Copy link
Contributor

@ikkz ikkz commented Aug 30, 2024

related issue: #2057

This pr implements the same function with rollup's preventAssignment: https://github.com/rollup/plugins/blob/master/packages/replace/src/index.js#L77-L82

And part of the logic is put into the match loop, because of fancy-regex's limitation that variable size of expression cannot be used in lookbehind (fancy-regex/fancy-regex#74 and fancy-regex/fancy-regex#109)

Copy link

netlify bot commented Aug 30, 2024

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit dd13452
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/66d1b73dc9239e0008737f35

@ikkz ikkz force-pushed the feat/replace-prevent-assignment branch from 49cac21 to f5b4ba1 Compare August 30, 2024 11:54
@ikkz ikkz marked this pull request as draft August 30, 2024 12:00
@ikkz ikkz force-pushed the feat/replace-prevent-assignment branch from f5b4ba1 to dd13452 Compare August 30, 2024 12:12
@ikkz ikkz marked this pull request as ready for review August 30, 2024 12:45
@hyf0
Copy link
Member

hyf0 commented Aug 30, 2024

And part of the logic is put into the match loop, because of fancy-regex's limitation that variable size of expression cannot be used in lookbehind (fancy-regex/fancy-regex#74 and fancy-regex/fancy-regex#109)

Looks like both regex and fancy_regex have issues on porting regex of js. I'm considering taking https://github.com/ridiculousfish/regress or https://github.com/hyf0/ecma_regex/issues more seriously.

Copy link
Member

@hyf0 hyf0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@hyf0 hyf0 added this pull request to the merge queue Aug 30, 2024
Merged via the queue into rolldown:main with commit 18ac29c Aug 30, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants