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!: Avoid modifying arguments #21

Merged
merged 2 commits into from
Jul 1, 2022
Merged

fix!: Avoid modifying arguments #21

merged 2 commits into from
Jul 1, 2022

Conversation

fasttime
Copy link
Contributor

Currently, plugin-error modifies the arguments provided to it (errors or option objects) by adding a plugin property and sometimes a error or message property to them. This is inconvenient because sometimes you would like to reuse an argument later without having it modified after the first usage of plugin-error.

This PR changes the current behavior by ensuring that the argument interpreted as an options object is shallow-cloned before any additional properties are set.

@fasttime fasttime marked this pull request as ready for review May 19, 2022 05:09
@yocontra
Copy link
Member

This seems fine to me - sorry that we were modifying the input object in the first place!

@phated
Copy link
Member

phated commented May 23, 2022

Even if this was bad, we need to treat it as a breaking fix because people might be relying on the inappropriate behavior

If we're doing a breaking release, we'll also want to upgrade the repo scaffold.

@phated phated added this to In progress in v5 Jun 27, 2022
@phated phated changed the title Fix: do not modify arguments fix!: Avoid modifying arguments Jul 1, 2022
Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

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

Looks good to me! I'm going to apply the repository updates and then rebase this on top

index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@phated phated merged commit 6c05aba into gulpjs:master Jul 1, 2022
@phated
Copy link
Member

phated commented Jul 1, 2022

Thanks @fasttime 🎉

@github-actions github-actions bot mentioned this pull request Jul 1, 2022
@phated phated moved this from In progress to Done in v5 Jul 1, 2022
@fasttime
Copy link
Contributor Author

fasttime commented Jul 2, 2022

Thanks @yocontra and @phated for reviewing and merging this. Happy I could help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v5
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants