Skip to content

Commit

Permalink
Merge pull request #1231 from embroider-build/ignore-weird-addons
Browse files Browse the repository at this point in the history
Followup to "Detect addons with customized treeForMethod names"
  • Loading branch information
ef4 authored Jul 4, 2022
2 parents 28f8c99 + 68851b2 commit 5b1f8d2
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 5b1f8d2

Please sign in to comment.