Skip to content

Commit

Permalink
Merge branch 'master' into fix-className-bindings-master
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Apr 19, 2019
2 parents 3b7c9f8 + 176c001 commit 652fea9
Show file tree
Hide file tree
Showing 6 changed files with 381 additions and 659 deletions.
3 changes: 2 additions & 1 deletion lib/legacy/legacy-data-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ export const LegacyDataMixin = dedupingMixin(superClass => {
// undefined or not. Multi-property observers must have all arguments defined
if (this._legacyUndefinedCheck && vals.length > 1) {
for (let i=0; i<vals.length; i++) {
if (vals[i] === undefined) {
if (vals[i] === undefined ||
(args[i].wildcard && vals[i].base === undefined)) {
// Break out of effect's control flow; will be caught in
// wrapped property effect function below
const name = args[i].name;
Expand Down
4 changes: 2 additions & 2 deletions lib/mixins/element-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -672,9 +672,9 @@ export const ElementMixin = dedupingMixin(base => {
if (n.attachShadow) {
if (dom) {
if (!n.shadowRoot) {
n.attachShadow({mode: 'open'});
n.attachShadow({mode: 'open', shadyUpgradeFragment: dom});
n.shadowRoot.appendChild(dom);
}
n.shadowRoot.appendChild(dom);
if (syncInitialRender && window.ShadyDOM) {
ShadyDOM.flushInitial(n.shadowRoot);
}
Expand Down
10 changes: 9 additions & 1 deletion lib/utils/templatize.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,14 @@ function createTemplatizerClass(template, templateInfo, options) {
}

/**
* Adds propagate effects from the template to the template instance for
* properties that the host binds to the template using the `_host_` prefix.
*
* @suppress {missingProperties} class.prototype is not defined for some reason
*/
function addPropagateEffects(template, templateInfo, options) {
let userForwardHostProp = options.forwardHostProp;
if (userForwardHostProp) {
if (userForwardHostProp && templateInfo.hasHostProps) {
// Provide data API and property effects on memoized template class
let klass = templateInfo.templatizeTemplateClass;
if (!klass) {
Expand Down Expand Up @@ -423,6 +426,11 @@ function addNotifyEffects(klass, template, templateInfo, options) {
}
if (options.forwardHostProp && template.__dataHost) {
for (let hprop in hostProps) {
// As we're iterating hostProps in this function, note whether
// there were any, for an optimization in addPropagateEffects
if (!templateInfo.hasHostProps) {
templateInfo.hasHostProps = true;
}
klass.prototype._addPropertyEffect(hprop,
klass.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,
{fn: createNotifyHostPropEffect()});
Expand Down
Loading

0 comments on commit 652fea9

Please sign in to comment.