Skip to content

Commit

Permalink
Merge pull request #11512 from stefanpenner/pr-10669-rebase
Browse files Browse the repository at this point in the history
[Bugfix release] Deprecate Ember.oneWay
  • Loading branch information
rwjblue committed Jun 19, 2015
2 parents bc7ec8d + e56650d commit d8b1bb1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,20 @@ QUnit.test('should update bound values after view\'s parent is removed and then
});

QUnit.test('should accept bindings as a string or an Ember.Binding', function() {
var ViewWithBindings = EmberView.extend({
oneWayBindingTestBinding: Binding.oneWay('context.direction'),
twoWayBindingTestBinding: Binding.from('context.direction'),
stringBindingTestBinding: 'context.direction',
template: compile(
'one way: {{view.oneWayBindingTest}}, ' +
'two way: {{view.twoWayBindingTest}}, ' +
'string: {{view.stringBindingTest}}'
)
});
var ViewWithBindings;

expectDeprecation(function() {
ViewWithBindings = EmberView.extend({
oneWayBindingTestBinding: Binding.oneWay('context.direction'),
twoWayBindingTestBinding: Binding.from('context.direction'),
stringBindingTestBinding: 'context.direction',
template: compile(
'one way: {{view.oneWayBindingTest}}, ' +
'two way: {{view.twoWayBindingTest}}, ' +
'string: {{view.stringBindingTest}}'
)
});
}, 'Ember.oneWay has been deprecated. Please use Ember.computed.oneWay instead.');

view = EmberView.create({
viewWithBindingsClass: ViewWithBindings,
Expand Down
1 change: 1 addition & 0 deletions packages/ember-metal/lib/binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ mixinProperties(Binding, {
@public
*/
oneWay(from, flag) {
Ember.deprecate('Ember.oneWay has been deprecated. Please use Ember.computed.oneWay instead.', false);
var C = this;
return new C(undefined, from).oneWay(flag);
}
Expand Down

0 comments on commit d8b1bb1

Please sign in to comment.