Skip to content

Commit

Permalink
Merge pull request #11777 from martndemus/remove-each-single-arg
Browse files Browse the repository at this point in the history
[CLEANUP beta] Remove `{{each model}}` (single arg each).
  • Loading branch information
rwjblue committed Jul 16, 2015
2 parents 69f42a0 + 9864fcb commit a4cd7be
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 87 deletions.
63 changes: 0 additions & 63 deletions packages/ember-htmlbars/tests/helpers/each_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -640,37 +640,6 @@ QUnit.test('views inside #each preserve the new context [DEPRECATED]', function(
equal(view.$().text(), 'AdamSteve');
});

QUnit.test('single-arg each defaults to current context [DEPRECATED]', function() {
runDestroy(view);

view = EmberView.create({
context: A([{ name: 'Adam' }, { name: 'Steve' }]),
template: compile('{{#each}}{{name}}{{/each}}')
});

expectDeprecation(function() {
runAppend(view);
}, eachDeprecation);

equal(view.$().text(), 'AdamSteve');
});

QUnit.test('single-arg each will iterate over controller if present [DEPRECATED]', function() {
runDestroy(view);

view = EmberView.create({
controller: A([{ name: 'Adam' }, { name: 'Steve' }]),
template: compile('{{#each}}{{name}}{{/each}}'),
container: container
});

expectDeprecation(function() {
runAppend(view);
}, eachDeprecation);

equal(view.$().text(), 'AdamSteve');
});

function testEachWithItem(moduleName, useBlockParams) {
QUnit.module(moduleName, {
setup() {
Expand Down Expand Up @@ -800,38 +769,6 @@ function testEachWithItem(moduleName, useBlockParams) {
equal(view.$().text(), 'BobSteve');
});

if (!useBlockParams) {
QUnit.test('{{each}} without arguments [DEPRECATED]', function() {
expect(2);

view = EmberView.create({
controller: A([{ name: 'Adam' }, { name: 'Steve' }]),
template: compile('{{#each}}{{name}}{{/each}}')
});

expectDeprecation(function() {
runAppend(view);
}, eachDeprecation);

equal(view.$().text(), 'AdamSteve');
});

QUnit.test('{{each this}} without keyword [DEPRECATED]', function() {
expect(2);

view = EmberView.create({
controller: A([{ name: 'Adam' }, { name: 'Steve' }]),
template: compile('{{#each this}}{{name}}{{/each}}')
});

expectDeprecation(function() {
runAppend(view);
}, eachDeprecation);

equal(view.$().text(), 'AdamSteve');
});
}

if (useBlockParams) {
QUnit.test('the index is passed as the second parameter to #each blocks', function() {
expect(3);
Expand Down
2 changes: 0 additions & 2 deletions packages/ember-template-compiler/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { registerPlugin } from 'ember-template-compiler/plugins';

import TransformWithAsToHash from 'ember-template-compiler/plugins/transform-with-as-to-hash';
import TransformEachIntoCollection from 'ember-template-compiler/plugins/transform-each-into-collection';
import TransformSingleArgEach from 'ember-template-compiler/plugins/transform-single-arg-each';
import TransformOldBindingSyntax from 'ember-template-compiler/plugins/transform-old-binding-syntax';
import TransformOldClassBindingSyntax from 'ember-template-compiler/plugins/transform-old-class-binding-syntax';
import TransformItemClass from 'ember-template-compiler/plugins/transform-item-class';
Expand All @@ -22,7 +21,6 @@ import DeprecateViewHelper from 'ember-template-compiler/plugins/deprecate-view-
import 'ember-template-compiler/compat';

registerPlugin('ast', TransformWithAsToHash);
registerPlugin('ast', TransformSingleArgEach);
registerPlugin('ast', TransformEachIntoCollection);
registerPlugin('ast', TransformOldBindingSyntax);
registerPlugin('ast', TransformOldClassBindingSyntax);
Expand Down

This file was deleted.

0 comments on commit a4cd7be

Please sign in to comment.