Skip to content

Default fileLookup to {} instead of null.#233

Merged
rwjblue merged 2 commits intoember-cli-code-coverage:masterfrom
ventuno:fix-232
Feb 11, 2020
Merged

Default fileLookup to {} instead of null.#233
rwjblue merged 2 commits intoember-cli-code-coverage:masterfrom
ventuno:fix-232

Conversation

@ventuno
Copy link

@ventuno ventuno commented Nov 15, 2019

Attempt to fix #232.
See a detailed description and analysis of the issue in #232.

The idea is to default fileLookup to {} instead of null this way regardless of the fact that included will run or not fileLookup should always be non-null.

I'm not 100% sure if this is the best fix for this issue. The issue may be elsewhere in the addons system. I'll leave the reviewer(s) weigh in on this.

index.js Outdated
const EXT_RE = /\.[^\.]+$/;

let fileLookup = null;
let fileLookup = {};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, I actually think that #182 was not the right path forward here. Keeping this in module scope means we don't support running multiple projects within the same process.

Can you tweak things to instead revert the changes in #182 (which will bring back this.fileLookup) and then initialize it in init? It will have the same basic result as this PR does now (and fix the issue that #182 was also trying to fix), but will avoid that downside...

Copy link
Author

Choose a reason for hiding this comment

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

Makes total sense, done. Can you please take another look?

@rwjblue rwjblue merged commit 53ab700 into ember-cli-code-coverage:master Feb 11, 2020
@ventuno ventuno deleted the fix-232 branch February 12, 2020 00:38
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.

TypeError: Cannot convert undefined or null to object

2 participants