Skip to content

Commit

Permalink
fix(deprecation): prefer _setClassicDecorator over _setComputedDecorator
Browse files Browse the repository at this point in the history
This fixes the deprecation added in Ember by PR emberjs/ember.js#17833.
  • Loading branch information
josemarluedke committed Apr 3, 2019
1 parent de28486 commit c9e47f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/object/addon/-private/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ export function legacyMacroWithMethod(fn, required) {
computed(elementDesc);
};

Ember._setComputedDecorator(decorator);
let setClassicDecorator = Ember._setClassicDecorator || Ember._setComputedDecorator;
setClassicDecorator(decorator);

if (DEBUG) {
// This is for wrapComputed to check against invalid input
Expand Down
3 changes: 2 additions & 1 deletion packages/utils/addon/computed.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ if (gte('3.10.0')) {
decorator.__computed = computed;
Object.setPrototypeOf(decorator, ComputedDecoratorImpl.prototype);

Ember._setComputedDecorator(decorator);
let setClassicDecorator = Ember._setClassicDecorator || Ember._setComputedDecorator;
setClassicDecorator(decorator);

if (DEBUG) {
// This is for wrapComputed to check against invalid input
Expand Down

0 comments on commit c9e47f1

Please sign in to comment.