Permalink
Browse files

feat(watch): Added support for Date, Map and WeakMap. Fix for #5.

  • Loading branch information...
calebdwilliams committed Aug 18, 2018
1 parent b5fc0a6 commit cfa9919e815077d42203ab2e460b517210cf0928
@@ -20,24 +20,24 @@ <h1>
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">81.74% </span>
<span class="strong">81.7% </span>
<span class="quiet">Statements</span>
<span class='fraction'>300/367</span>
<span class='fraction'>308/377</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">69.76% </span>
<span class="strong">69.52% </span>
<span class="quiet">Branches</span>
<span class='fraction'>143/205</span>
<span class='fraction'>146/210</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">83.33% </span>
<span class="strong">84.09% </span>
<span class="quiet">Functions</span>
<span class='fraction'>35/42</span>
<span class='fraction'>37/44</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">84.01% </span>
<span class="strong">83.9% </span>
<span class="quiet">Lines</span>
<span class='fraction'>289/344</span>
<span class='fraction'>297/354</span>
</div>
</div>
</div>
@@ -60,15 +60,15 @@ <h1>
</thead>
<tbody><tr>
<td class="file high" data-value="src/"><a href="src/index.html">src/</a></td>
<td data-value="81.74" class="pic high"><div class="chart"><div class="cover-fill" style="width: 81%;"></div><div class="cover-empty" style="width:19%;"></div></div></td>
<td data-value="81.74" class="pct high">81.74%</td>
<td data-value="367" class="abs high">300/367</td>
<td data-value="69.76" class="pct medium">69.76%</td>
<td data-value="205" class="abs medium">143/205</td>
<td data-value="83.33" class="pct high">83.33%</td>
<td data-value="42" class="abs high">35/42</td>
<td data-value="84.01" class="pct high">84.01%</td>
<td data-value="344" class="abs high">289/344</td>
<td data-value="81.7" class="pic high"><div class="chart"><div class="cover-fill" style="width: 81%;"></div><div class="cover-empty" style="width:19%;"></div></div></td>
<td data-value="81.7" class="pct high">81.7%</td>
<td data-value="377" class="abs high">308/377</td>
<td data-value="69.52" class="pct medium">69.52%</td>
<td data-value="210" class="abs medium">146/210</td>
<td data-value="84.09" class="pct high">84.09%</td>
<td data-value="44" class="abs high">37/44</td>
<td data-value="83.9" class="pct high">83.9%</td>
<td data-value="354" class="abs high">297/354</td>
</tr>

</tbody>
@@ -77,7 +77,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Aug 07 2018 19:49:24 GMT-0500 (CDT)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Aug 18 2018 15:11:58 GMT-0500 (CDT)
</div>
</div>
<script src="prettify.js"></script>
@@ -20,24 +20,24 @@ <h1>
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">81.74% </span>
<span class="strong">81.7% </span>
<span class="quiet">Statements</span>
<span class='fraction'>300/367</span>
<span class='fraction'>308/377</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">69.76% </span>
<span class="strong">69.52% </span>
<span class="quiet">Branches</span>
<span class='fraction'>143/205</span>
<span class='fraction'>146/210</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">83.33% </span>
<span class="strong">84.09% </span>
<span class="quiet">Functions</span>
<span class='fraction'>35/42</span>
<span class='fraction'>37/44</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">84.01% </span>
<span class="strong">83.9% </span>
<span class="quiet">Lines</span>
<span class='fraction'>289/344</span>
<span class='fraction'>297/354</span>
</div>
</div>
</div>
@@ -60,15 +60,15 @@ <h1>
</thead>
<tbody><tr>
<td class="file high" data-value="templiteral.js"><a href="templiteral.js.html">templiteral.js</a></td>
<td data-value="81.74" class="pic high"><div class="chart"><div class="cover-fill" style="width: 81%;"></div><div class="cover-empty" style="width:19%;"></div></div></td>
<td data-value="81.74" class="pct high">81.74%</td>
<td data-value="367" class="abs high">300/367</td>
<td data-value="69.76" class="pct medium">69.76%</td>
<td data-value="205" class="abs medium">143/205</td>
<td data-value="83.33" class="pct high">83.33%</td>
<td data-value="42" class="abs high">35/42</td>
<td data-value="84.01" class="pct high">84.01%</td>
<td data-value="344" class="abs high">289/344</td>
<td data-value="81.7" class="pic high"><div class="chart"><div class="cover-fill" style="width: 81%;"></div><div class="cover-empty" style="width:19%;"></div></div></td>
<td data-value="81.7" class="pct high">81.7%</td>
<td data-value="377" class="abs high">308/377</td>
<td data-value="69.52" class="pct medium">69.52%</td>
<td data-value="210" class="abs medium">146/210</td>
<td data-value="84.09" class="pct high">84.09%</td>
<td data-value="44" class="abs high">37/44</td>
<td data-value="83.9" class="pct high">83.9%</td>
<td data-value="354" class="abs high">297/354</td>
</tr>

</tbody>
@@ -77,7 +77,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Aug 07 2018 19:49:24 GMT-0500 (CDT)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Aug 18 2018 15:11:58 GMT-0500 (CDT)
</div>
</div>
<script src="../prettify.js"></script>
@@ -20,24 +20,24 @@ <h1>
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">81.74% </span>
<span class="strong">81.7% </span>
<span class="quiet">Statements</span>
<span class='fraction'>300/367</span>
<span class='fraction'>308/377</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">69.76% </span>
<span class="strong">69.52% </span>
<span class="quiet">Branches</span>
<span class='fraction'>143/205</span>
<span class='fraction'>146/210</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">83.33% </span>
<span class="strong">84.09% </span>
<span class="quiet">Functions</span>
<span class='fraction'>35/42</span>
<span class='fraction'>37/44</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">84.01% </span>
<span class="strong">83.9% </span>
<span class="quiet">Lines</span>
<span class='fraction'>289/344</span>
<span class='fraction'>297/354</span>
</div>
</div>
</div>
@@ -671,7 +671,22 @@ <h1>
626
627
628
629</td><td class="line-coverage quiet"><span class="cline-any cline-yes">1×</span>
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644</td><td class="line-coverage quiet"><span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
@@ -721,6 +736,7 @@ <h1>
<span class="cline-any cline-yes">203×</span>
<span class="cline-any cline-yes">203×</span>
<span class="cline-any cline-yes">203×</span>
<span class="cline-any cline-yes">203×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">95×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
@@ -962,10 +978,17 @@ <h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">342×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">86×</span>
<span class="cline-any cline-yes">86×</span>
<span class="cline-any cline-yes">86×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">86×</span>
<span class="cline-any cline-yes">86×</span>
<span class="cline-any cline-yes">86×</span>
<span class="cline-any cline-yes">86×</span>
<span class="cline-any cline-yes">86×</span>
@@ -1032,6 +1055,12 @@ <h1>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
@@ -1205,8 +1234,6 @@ <h1>
<span class="cline-any cline-yes">44×</span>
<span class="cline-any cline-yes">44×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">44×</span>
@@ -1219,6 +1246,9 @@ <h1>
<span class="cline-any cline-yes">44×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">44×</span>
<span class="cline-any cline-yes">44×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
@@ -1270,9 +1300,9 @@ <h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">88×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">88×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
@@ -1330,7 +1360,7 @@ <h1>
update(values) {
this.node.nodeValue = this.base.replace(matchPattern, match =&gt; {
const value = values[valueToInt(match)];
return value === null ? <span class="branch-0 cbranch-no" title="branch not covered" >'' </span>: values[valueToInt(match)]
return value === null ? <span class="branch-0 cbranch-no" title="branch not covered" >'' </span>: values[valueToInt(match)];
});
}
}
@@ -1346,6 +1376,7 @@ <h1>
attribute.base = attribute.value;
attribute.bases = attribute.base.match(matchPattern) || <span class="branch-1 cbranch-no" title="branch not covered" >[];</span>
attribute.baseIndicies = attribute.bases.map(valueToInt);
attribute.cleanName = attribute.name.replace(/\[|\]/g, '');
const indicies = attribute.base.match(valuePattern) || <span class="branch-1 cbranch-no" title="branch not covered" >[];</span>
this.indicies = indicies.map(valueToInt);
this.indicies.forEach(index =&gt; this.compiler.partIndicies.set(index, this));
@@ -1371,7 +1402,7 @@ <h1>
}
&nbsp;
updateProperty(attribute, attributeValue) {
const attributeName = attribute.name.replace(/\[|\]/g, '');
const attributeName = attribute.cleanName;
!this.context.DEBUG ? this.node.removeAttribute(attribute.name) : <span class="branch-1 cbranch-no" title="branch not covered" >null;</span>
this.node[attributeName] = attributeValue;
if (attributeValue &amp;&amp; (attributeValue !== 'false' &amp;&amp; attributeValue !== 'undefined')) {
@@ -1577,8 +1608,8 @@ <h1>
}
}
&nbsp;
_init() {
const _base = this.strings.map((string, index) =&gt; {
_createBase() {
return this.strings.map((string, index) =&gt; {
const value = this.values[index];
const interpolationValue = `---!{${index}}!---`;
let output = '';
@@ -1590,10 +1621,17 @@ <h1>
}
return output;
}).join('');
}
&nbsp;
_createNode(baseText) {
const fragment = document.createElement('template');
fragment.innerHTML = _base;
const baseNode = document.importNode(fragment.content, true);
fragment.innerHTML = baseText;
return document.importNode(fragment.content, true);
}
&nbsp;
_init() {
const base = this._createBase();
const baseNode = this._createNode(base);
const walker = document.createTreeWalker(baseNode, 133, null, false);
this._walk(walker, this.parts, true);
this._append(baseNode);
@@ -1657,9 +1695,15 @@ <h1>
&nbsp;
[removeSymbol]() {
this.nodes.forEach(templateChild =&gt; templateChild.parentNode.removeChild(templateChild));
this.nodes = null;
this.parts
.filter(part =&gt; part instanceof AttributeNode)
.forEach(part =&gt; part.disconnect());
this.parts = null;
this.partIndicies = null;
this.context = null;
this.location = null;
this.group = null;
}
}
&nbsp;
@@ -1823,7 +1867,7 @@ <h1>
}
&nbsp;
get $$renderListener() {
return debounce(this[this.constructor.renderer].bind(this), 0, true);
return this[this.constructor.renderer];
}

connectedCallback() {
@@ -1832,8 +1876,6 @@ <h1>
&nbsp;
<span class="missing-if-branch" title="else path not taken" >E</span>if (!this.$$listening) {
this.addEventListener('ComponentRender', this.$$renderListener);
} else {
<span class="cstat-no" title="statement not covered" > console.log(this, this.$$listening, !this.$$listening );</span>
}
}

@@ -1847,6 +1889,9 @@ <h1>
this.$$listening = false;
}
this[rendererSymbol] &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >this[rendererSymbol][removeSymbol]();</span>
<span class="missing-if-branch" title="if path not taken" >I</span>if (this.onDestroy &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >typeof this.onDestroy === 'function')</span> {
<span class="cstat-no" title="statement not covered" > this.onDestroy();</span>
}
}
&nbsp;
emit(eventName, detail) {
@@ -1864,12 +1909,12 @@ <h1>
const desc = Object.getOwnPropertyDescriptor(target, property);
const value = Reflect.get(target, property, receiver);
&nbsp;
if (desc &amp;&amp; !desc.writable &amp;&amp; !desc.configurable &amp;&amp; property !== 'push') {
if (desc &amp;&amp; !desc.writable &amp;&amp; !desc.configurable) {
return value;
}
&nbsp;
try {
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof target[property] === 'function' &amp;&amp; target instanceof Date) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof target[property] === 'function' &amp;&amp; (target instanceof Date || target instanceof Map ||target instanceof WeakMap)) {
<span class="cstat-no" title="statement not covered" > return new Proxy(target[property].bind(target), handler);</span>
}
return new Proxy(target[property], handler);
@@ -1898,9 +1943,9 @@ <h1>
};
&nbsp;
const debounce = (fn, wait, immediate) =&gt; {
let timeout;
<span class="cstat-no" title="statement not covered" > let timeout;</span>
&nbsp;
return <span class="fstat-no" title="function not covered" >function executed(...args) {</span>
<span class="cstat-no" title="statement not covered" > return <span class="fstat-no" title="function not covered" >function executed(...args) {</span></span>
<span class="cstat-no" title="statement not covered" > const context = this;</span>

<span class="cstat-no" title="statement not covered" > const later = () =&gt; {</span>
@@ -1933,7 +1978,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Aug 07 2018 19:49:24 GMT-0500 (CDT)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Aug 18 2018 15:11:58 GMT-0500 (CDT)
</div>
</div>
<script src="../prettify.js"></script>
Oops, something went wrong.

0 comments on commit cfa9919

Please sign in to comment.