Skip to content

Commit

Permalink
Followup to "Detect addons with customized treeForMethod names"
Browse files Browse the repository at this point in the history
The bugfix in #1230 caused us to start detecting some very weird old addons as having customized trees, and we can't really do anything with those. It was better to give them the stock tree behaviors.
  • Loading branch information
ef4 committed Jul 4, 2022
1 parent 28f8c99 commit 68851b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/compat/src/v1-addon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,14 @@ export default class V1Addon {
}

private customizesHookName(treeName: string): boolean {
if (!this.addonInstance.treeForMethods) {
// weird old addons don't even extend ember-cli's Addon base class and
// might not have this.
return false;
}
for (let [name, methodName] of Object.entries(defaultMethods)) {
if (methodName === treeName) {
return this.addonInstance.treeForMethods?.[name] !== methodName;
return this.addonInstance.treeForMethods[name] !== methodName;
}
}
return false;
Expand Down

0 comments on commit 68851b2

Please sign in to comment.