diff --git a/packages/ember-glimmer/lib/renderer.js b/packages/ember-glimmer/lib/renderer.js index 2c17e8a3b0c..e598f0d96e8 100644 --- a/packages/ember-glimmer/lib/renderer.js +++ b/packages/ember-glimmer/lib/renderer.js @@ -70,9 +70,7 @@ class RootState { let result = this.result = iteratorResult.value; // override .render function after initial render - this.render = () => { - result.rerender(options); - }; + this.render = () => result.rerender(options); }; } diff --git a/packages/ember-runtime/lib/computed/reduce_computed_macros.js b/packages/ember-runtime/lib/computed/reduce_computed_macros.js index 5745c10ff7d..13b81512664 100644 --- a/packages/ember-runtime/lib/computed/reduce_computed_macros.js +++ b/packages/ember-runtime/lib/computed/reduce_computed_macros.js @@ -4,14 +4,13 @@ */ import { guidFor } from 'ember-utils'; -import { assert, Error as EmberError } from 'ember-debug'; +import { assert } from 'ember-debug'; import { get, ComputedProperty, computed, addObserver, removeObserver, - isNone, getProperties, WeakMap } from 'ember-metal'; @@ -573,9 +572,9 @@ export function intersect(...args) { @public */ export function setDiff(setAProperty, setBProperty) { - if (arguments.length !== 2) { - throw new EmberError('setDiff requires exactly two dependent arrays.'); - } + assert('Ember.computed.setDiff requires exactly two dependent arrays.', + arguments.length === 2 + ); return computed(`${setAProperty}.[]`, `${setBProperty}.[]`, function() { let setA = this.get(setAProperty); @@ -620,7 +619,7 @@ export function collect(...dependentKeys) { let res = emberA(); for (let key in properties) { if (properties.hasOwnProperty(key)) { - if (isNone(properties[key])) { + if (properties[key] === undefined) { res.push(null); } else { res.push(properties[key]); diff --git a/packages/ember-runtime/tests/computed/reduce_computed_macros_test.js b/packages/ember-runtime/tests/computed/reduce_computed_macros_test.js index bdf336810f6..7c13a55d879 100644 --- a/packages/ember-runtime/tests/computed/reduce_computed_macros_test.js +++ b/packages/ember-runtime/tests/computed/reduce_computed_macros_test.js @@ -639,17 +639,17 @@ QUnit.test('setDiff is readOnly', function() { }, /Cannot set read-only property "diff" on object:/); }); -QUnit.test('it throws an error if given fewer or more than two dependent properties', function() { - throws(function () { +QUnit.test('it asserts if given fewer or more than two dependent properties', function() { + expectAssertion(function () { EmberObject.extend({ diff: setDiff('array') }).create({ array: emberA([1, 2, 3, 4, 5, 6, 7]), array2: emberA([3, 4, 5]) }); - }, /requires exactly two dependent arrays/, 'setDiff requires two dependent arrays'); + }, /Ember\.computed\.setDiff requires exactly two dependent arrays/, 'setDiff requires two dependent arrays'); - throws(function () { + expectAssertion(function () { EmberObject.extend({ diff: setDiff('array', 'array2', 'array3') }).create({ @@ -657,7 +657,7 @@ QUnit.test('it throws an error if given fewer or more than two dependent propert array2: emberA([3, 4, 5]), array3: emberA([7]) }); - }, /requires exactly two dependent arrays/, 'setDiff requires two dependent arrays'); + }, /Ember\.computed\.setDiff requires exactly two dependent arrays/, 'setDiff requires two dependent arrays'); });