Skip to content

Commit

Permalink
Merge pull request #24 from lennyburdette/patch-3
Browse files Browse the repository at this point in the history
 fix: using ...attributes without passing attrs fails
  • Loading branch information
rwjblue authored Jul 11, 2018
2 parents 139b986 + d58f072 commit 5b9df66
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions tests/integration/components/angle-bracket-invocation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,5 +318,16 @@ module('Integration | Component | angle-bracket-invocation', function(hooks) {

assert.dom('span[data-test-my-thing]').hasText('hi martin!');
});

test('passing into element - unused', async function(assert) {
this.owner.register(
'template:components/foo-bar',
hbs`<span ...attributes>hi martin!</span>`
);

await render(hbs`<FooBar />`);

assert.dom('span').hasText('hi martin!');
});
});
});
4 changes: 2 additions & 2 deletions vendor/angle-bracket-invocation-polyfill/runtime-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ import { lte, gte } from 'ember-compatibility-helpers';
let { positional } = args.capture();
let invocationAttributesReference = positional.at(0);
let invocationAttributes = invocationAttributesReference.value();
let attributeNames = Object.keys(invocationAttributes);
let attributeNames = invocationAttributes ? Object.keys(invocationAttributes) : [];
let dynamicAttributes = {};

for (let i = 0; i < attributeNames.length; i++) {
Expand Down Expand Up @@ -235,7 +235,7 @@ import { lte, gte } from 'ember-compatibility-helpers';
let positional = gte('2.15.0-beta.1') ? args.capture().positional : args.positional;
let invocationAttributesReference = positional.at(0);
let invocationAttributes = invocationAttributesReference.value();
let attributeNames = Object.keys(invocationAttributes);
let attributeNames = invocationAttributes ? Object.keys(invocationAttributes) : [];
let dynamicAttributes = {};

for (let i = 0; i < attributeNames.length; i++) {
Expand Down

0 comments on commit 5b9df66

Please sign in to comment.