Skip to content

Commit

Permalink
Merge pull request #11914 from rwjblue/remove-ember-oneway
Browse files Browse the repository at this point in the history
[CLEANUP beta] Remove `Ember.oneWay`.
  • Loading branch information
rwjblue committed Jul 29, 2015
2 parents df9fba3 + c650f1d commit e5c6490
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 98 deletions.
15 changes: 0 additions & 15 deletions packages/ember-metal/lib/binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,21 +466,6 @@ export function bind(obj, to, from) {
return new Binding(to, from).connect(obj);
}

/**
@method oneWay
@for Ember
@param {Object} obj The root object of the transform.
@param {String} to The path to the 'to' side of the binding.
Must be relative to obj.
@param {String} from The path to the 'from' side of the binding.
Must be relative to obj or a global path.
@return {Ember.Binding} binding instance
@public
*/
export function oneWay(obj, to, from) {
return new Binding(to, from).oneWay().connect(obj);
}

export {
Binding,
isGlobalPath
Expand Down
4 changes: 1 addition & 3 deletions packages/ember-metal/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ import {
import {
Binding,
bind,
isGlobalPath,
oneWay
isGlobalPath
} from 'ember-metal/binding';
import run from 'ember-metal/run_loop';
import Libraries from 'ember-metal/libraries';
Expand Down Expand Up @@ -309,7 +308,6 @@ Ember.immediateObserver = _immediateObserver;
Ember.mixin = mixin;
Ember.Mixin = Mixin;

Ember.oneWay = oneWay;
Ember.bind = bind;
Ember.Binding = Binding;
Ember.isGlobalPath = isGlobalPath;
Expand Down
44 changes: 0 additions & 44 deletions packages/ember-metal/tests/binding/one_way_test.js

This file was deleted.

37 changes: 1 addition & 36 deletions packages/ember-runtime/tests/legacy_1x/system/binding_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Ember from 'ember-metal/core';
import {get} from 'ember-metal/property_get';
import {set} from 'ember-metal/property_set';
import run from 'ember-metal/run_loop';
import {Binding, bind, oneWay} from 'ember-metal/binding';
import {Binding, bind } from 'ember-metal/binding';
import {observer as emberObserver} from 'ember-metal/mixin';
import EmberObject from 'ember-runtime/system/object';

Expand Down Expand Up @@ -120,41 +120,6 @@ QUnit.test('binding disconnection actually works', function() {
equal(get(toObject, 'value'), 'start');
});

// ..........................................................
// one way binding
//

QUnit.module('one way binding', {

setup() {
run(function() {
fromObject = EmberObject.create({ value: 'start' });
toObject = EmberObject.create({ value: 'end' });
root = { fromObject: fromObject, toObject: toObject };
binding = oneWay(root, 'toObject.value', 'fromObject.value');
});
},
teardown() {
run.cancelTimers();
}
});

QUnit.test('fromObject change should propagate after flush', function() {
run(function() {
set(fromObject, 'value', 'change');
equal(get(toObject, 'value'), 'start');
});
equal(get(toObject, 'value'), 'change');
});

QUnit.test('toObject change should NOT propagate', function() {
run(function() {
set(toObject, 'value', 'change');
equal(get(fromObject, 'value'), 'start');
});
equal(get(fromObject, 'value'), 'start');
});

var first, second, third, binding1, binding2; // global variables

// ..........................................................
Expand Down

0 comments on commit e5c6490

Please sign in to comment.