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

fix(inject): Make pragma detection stricter #1648

Merged
merged 2 commits into from
Jul 6, 2023

Conversation

loewenheim
Copy link
Contributor

We only want to skip "actual" use pragmas and not those that are contained in some function object. Therefore we anchor the pragma regex to the start of the line.

@loewenheim loewenheim self-assigned this Jun 16, 2023
@loewenheim loewenheim requested a review from a team June 19, 2023 11:08
Copy link
Contributor

@kamilogorek kamilogorek left a comment

Choose a reason for hiding this comment

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

There are still some nasty cases like

"use strict"; // this is a multi-line
// banner comment
// that describes author, license, version etc.

which will end up as

"use strict"; // this is a multi-line
<our-snippet>
// banner comment
// that describes author, license, version etc.

But I dont think that it's a real problem here tbh. It will function just fine.

@loewenheim loewenheim merged commit 59e9f5c into master Jul 6, 2023
@loewenheim loewenheim deleted the fix/inject-fake-pragma branch July 6, 2023 09:27
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