From 697e9e5b33dbed25e1d2f1bdb6d88783c490cf99 Mon Sep 17 00:00:00 2001 From: Sergio Arbeo Date: Wed, 23 Dec 2015 00:01:06 +0100 Subject: [PATCH] [BUGFIX beta] Update htmlbar to 0.14.11 This fixes a bug where a component's cell was being leaked as the first positional parameter. Fixes #12717 --- npm-shrinkwrap.json | 6 ++-- package.json | 2 +- .../tests/helpers/closure_component_test.js | 34 +++++++++++++++++++ 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4e495ac0bd3..4920c8bb4b2 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2693,9 +2693,9 @@ "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-1.0.0.tgz" }, "htmlbars": { - "version": "0.14.10", - "from": "htmlbars@0.14.10", - "resolved": "https://registry.npmjs.org/htmlbars/-/htmlbars-0.14.10.tgz" + "version": "0.14.11", + "from": "htmlbars@0.14.11", + "resolved": "https://registry.npmjs.org/htmlbars/-/htmlbars-0.14.11.tgz" }, "htmlparser2": { "version": "3.8.3", diff --git a/package.json b/package.json index 41ac1863016..a004d954548 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/ember-htmlbars/tests/helpers/closure_component_test.js b/packages/ember-htmlbars/tests/helpers/closure_component_test.js index ee67003eac3..ba776547acc 100644 --- a/packages/ember-htmlbars/tests/helpers/closure_component_test.js +++ b/packages/ember-htmlbars/tests/helpers/closure_component_test.js @@ -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'; @@ -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',