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

Files leak across instances of Project #86

Closed
lolmaus opened this issue Dec 7, 2023 · 1 comment
Closed

Files leak across instances of Project #86

lolmaus opened this issue Dec 7, 2023 · 1 comment

Comments

@lolmaus
Copy link
Contributor

lolmaus commented Dec 7, 2023

    let project1 = new Project('my-app', '1.0.0');
    project1.files['foo.js'] = 'foo';

    let project2 = new Project('my-app', '1.0.0');

    expect(project2.files['foo.js']).to.be.undefined; // => 💣
    project2.files['foo.js'] // => 'foo'

There's a comment about shallow merging here, but the fact is that files are stored in a module-level variable that is simply assigned to the files instance property in teh constructor,

lolmaus added a commit to lolmaus/node-fixturify-project that referenced this issue Dec 7, 2023
@lolmaus
Copy link
Contributor Author

lolmaus commented Dec 7, 2023

This is likely to break a lot of tests in Embroider with scenario-tester.

@ef4 ef4 closed this as completed in e225549 Feb 13, 2024
ef4 added a commit that referenced this issue Feb 13, 2024
Fix #86 Files leak across instances of Project
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

No branches or pull requests

1 participant