Skip to content

Commit

Permalink
[BUGFIX beta] Update htmlbar to 0.14.11
Browse files Browse the repository at this point in the history
This fixes a bug where a component's cell was being leaked as the first
positional parameter.

Fixes emberjs#12717
  • Loading branch information
Serabe committed Dec 22, 2015
1 parent c3a8dcd commit 697e9e5
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
6 changes: 3 additions & 3 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"finalhandler": "^0.4.0",
"github": "^0.2.3",
"glob": "~4.3.2",
"htmlbars": "0.14.10",
"htmlbars": "0.14.11",
"qunit-extras": "^1.4.0",
"qunitjs": "^1.19.0",
"route-recognizer": "0.1.5",
Expand Down
34 changes: 34 additions & 0 deletions packages/ember-htmlbars/tests/helpers/closure_component_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Component from 'ember-views/components/component';
import compile from 'ember-template-compiler/system/compile';
import run from 'ember-metal/run_loop';
import isEnabled from 'ember-metal/features';
import isEmpty from 'ember-metal/is_empty';
import { OWNER } from 'container/owner';
import buildOwner from 'container/tests/test-helpers/build-owner';

Expand Down Expand Up @@ -514,6 +515,39 @@ if (isEnabled('ember-contextual-components')) {
equal(component.$().text(), `${expectedText},Hola`, '-looked-up component rendered with rest params');
});

QUnit.test('renders with dot path and rest parameter does not leak', function() {
let value = false;
let MyComponent = Component.extend({
didReceiveAttrs() {
value = this.getAttr('value');
}
});

MyComponent.reopenClass({
positionalParams: ['value']
});

owner.register(
'component:my-component',
MyComponent
);

let template = compile(
`{{#with (hash my-component=(component 'my-component')) as |c|}}
{{c.my-component }}
{{/with}}`
);

component = Component.extend({
[OWNER]: owner,
template
}).create();

runAppend(component);

ok(isEmpty(value), 'value is an empty parameter');
});

QUnit.test('renders with dot path and updates attributes', function() {
owner.register(
'component:my-nested-component',
Expand Down

0 comments on commit 697e9e5

Please sign in to comment.