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

Don't mutate the options object between files #7

Merged
merged 1 commit into from
Mar 10, 2015

Conversation

joshhunt
Copy link
Contributor

@joshhunt joshhunt commented Mar 5, 2015

Currently there's a bug in metadataMap - the metadataMap from the first file would be applied to app subsequent file. This is because the one options object is shared across all files, and then is mutated.

The if(!options.Metadata && options.metadataMap){} block will not be ran if options.Metadata exists, and then within that block, options is mutated to add options.Metadata, preventing it from updating for subsequent files. I fixed this my saving metadata into a new locally scoped metadata variable, and then saving that later into objOpts.Metadata.

Lead to a bug where the result of metadata map for the first file would result be applied to all subsequent files
@clineamb
Copy link
Owner

Whoop! Gotcha. Thanks for the update. (:

@clineamb clineamb closed this Mar 10, 2015
@clineamb clineamb reopened this Mar 10, 2015
clineamb added a commit that referenced this pull request Mar 10, 2015
Don't mutate the options object between files
@clineamb clineamb merged commit e9311d5 into clineamb:master Mar 10, 2015
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