Skip to content

Commit

Permalink
Merge pull request #11400 from cibernox/deprecate-any-macro
Browse files Browse the repository at this point in the history
[BUGFIX beta] Add deprecation to Ember.computed.any
  • Loading branch information
mixonic committed Jun 11, 2015
2 parents 7e7b5bf + 38060aa commit 499bb3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/ember-metal/lib/computed_macros.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ export var or = generateComputedWithProperties(function(properties) {
@public
*/
export var any = generateComputedWithProperties(function(properties) {
Ember.deprecate('Usage of Ember.computed.any is deprecated, use `Ember.computed.or` instead.');
for (var key in properties) {
if (properties.hasOwnProperty(key) && properties[key]) {
return properties[key];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ testBoth('computed.or', function(get, set) {
equal(get(obj, 'oneOrTwo'), 1, 'returns truthy value as in ||');
});

testBoth('computed.any', function(get, set) {
testBoth('computed.any (Deprecated)', function(get, set) {
expectDeprecation(/Usage of Ember.computed.any is deprecated, use `Ember.computed.or` instead/);
var obj = { one: 'foo', two: 'bar' };
defineProperty(obj, 'anyOf', any('one', 'two'));

Expand Down

0 comments on commit 499bb3c

Please sign in to comment.