Skip to content

Commit

Permalink
Remove @dependentKeyCompat assertion.
Browse files Browse the repository at this point in the history
The assertion helps prevent double work, but does not prevent
application errors/bugs (other than poor performance). This removes the
assertion and is intended for release in 3.22.2 and 3.20.7.

(cherry picked from commit 118f0f6)
  • Loading branch information
rwjblue authored and kategengler committed Nov 16, 2020
1 parent e9e26ce commit 2e3ad64
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/@ember/object/compat.ts
Expand Up @@ -2,21 +2,15 @@ import { Meta } from '@ember/-internals/meta';
import {
Decorator,
DecoratorPropertyDescriptor,
descriptorForProperty,
isElementDescriptor,
setClassicDecorator,
} from '@ember/-internals/metal';
import { assert } from '@ember/debug';
import { consumeTag, tagFor, track, UpdatableTag, updateTag } from '@glimmer/validator';

let wrapGetterSetter = function (target: object, key: string, desc: PropertyDescriptor) {
let wrapGetterSetter = function (_target: object, key: string, desc: PropertyDescriptor) {
let { get: originalGet } = desc;

assert(
'You attempted to use @dependentKeyCompat on a property that already has been decorated with either @computed or @tracked. @dependentKeyCompat is only necessary for native getters that are not decorated with @computed.',
descriptorForProperty(target, key) === undefined
);

if (originalGet !== undefined) {
desc.get = function () {
let propertyTag = tagFor(this, key) as UpdatableTag;
Expand Down

0 comments on commit 2e3ad64

Please sign in to comment.