ember.js
ember.js copied to clipboard
In classic classes, dependentKeyCompat does not accept a function, only an object with `get`
Documentation indicates that dependentKeyCompat should take a function, similar to computed
https://github.com/emberjs/ember.js/blob/5ec7e245235d1b915e3c622e98ae5a36d4a41a64/packages/%40ember/object/compat.ts#L75-L105
If I follow the example exactly, I trigger the assertion here https://github.com/emberjs/ember.js/blob/5ec7e245235d1b915e3c622e98ae5a36d4a41a64/packages/%40ember/object/compat.ts#L179-L182
Passing an object works:
fullName: dependentKeyCompat({
get() {
return `${this.firstName} ${this.lastName}`;
}
})