From 3b85907bdb485a40536a3a58c68f243010bea9ad Mon Sep 17 00:00:00 2001 From: Zack Mulgrew Date: Sat, 15 Oct 2016 22:53:19 -0700 Subject: [PATCH 1/3] Ensure a target param for actions with implicit this --- packages/ember-glimmer/lib/helpers/action.js | 7 +---- .../lib/plugins/transform-action-syntax.js | 29 +++++++++++++++++-- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/packages/ember-glimmer/lib/helpers/action.js b/packages/ember-glimmer/lib/helpers/action.js index a9cfc712614..33ba0f100d2 100644 --- a/packages/ember-glimmer/lib/helpers/action.js +++ b/packages/ember-glimmer/lib/helpers/action.js @@ -278,7 +278,7 @@ export class ClosureActionReference extends CachedReference { let { named, positional } = this.args; let positionalValues = positional.value(); - let target = positionalValues[0]; + let target = named.get('target').value(); let rawActionRef = positional.at(1); let rawAction = positionalValues[1]; @@ -305,11 +305,6 @@ export class ClosureActionReference extends CachedReference { action = null; - if (named.has('target')) { - // on-change={{action 'setName' target=alternativeComponent}} - target = named.get('target').value(); - } - if (target['actions']) { action = target.actions[actionName]; } diff --git a/packages/ember-template-compiler/lib/plugins/transform-action-syntax.js b/packages/ember-template-compiler/lib/plugins/transform-action-syntax.js index 2a26a0c14d4..87124b7dcd8 100644 --- a/packages/ember-template-compiler/lib/plugins/transform-action-syntax.js +++ b/packages/ember-template-compiler/lib/plugins/transform-action-syntax.js @@ -15,11 +15,13 @@ with ```handlebars -