summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_duplex.js.html
blob: a3f1208b4136a5fef12ecf966a4d08cd168ec396 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for lib/_stream_duplex.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../prettify.css" />
    <link rel="stylesheet" href="../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(../sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="../index.html">all files</a> / <a href="index.html">lib/</a> _stream_duplex.js
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">69.23% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>27/39</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">68.18% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>15/22</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">40% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>2/5</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">75.76% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>25/33</span>
      </div>
    </div>
  </div>
  <div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75</td><td class="line-coverage quiet"><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-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-neutral">&nbsp;</span>
<span class="cline-any cline-yes">49×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">49×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">49×</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">49×</span>
<span class="cline-any cline-yes">49×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">49×</span>
<span class="cline-any cline-yes">49×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">49×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">49×</span>
<span class="cline-any cline-yes">49×</span>
<span class="cline-any cline-yes">392×</span>
<span class="cline-any cline-yes">392×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">49×</span>
<span class="cline-any cline-yes">25×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">25×</span>
<span class="cline-any cline-yes">25×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">25×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">25×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">25×</span>
<span class="cline-any cline-yes">25×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">25×</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">49×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18×</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-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">49×</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-yes">49×</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-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// a duplex stream is just a stream that is both readable and writable.
// Since JS doesn't have multiple prototypal inheritance, this class
// prototypally inherits from Readable, and then parasitically from
// Writable.
&nbsp;
'use strict';
&nbsp;
/*&lt;replacement&gt;*/
&nbsp;
var objectKeys = Object.keys || <span class="fstat-no" title="function not covered" ><span class="branch-1 cbranch-no" title="branch not covered" >function (obj) {</span></span>
<span class="cstat-no" title="statement not covered" >  var keys = [];</span>
<span class="cstat-no" title="statement not covered" >  for (var key in obj) {</span>
<span class="cstat-no" title="statement not covered" >    keys.push(key);</span>
  }<span class="cstat-no" title="statement not covered" >return keys;</span>
};
/*&lt;/replacement&gt;*/
&nbsp;
module.exports = Duplex;
&nbsp;
/*&lt;replacement&gt;*/
var processNextTick = require('process-nextick-args');
/*&lt;/replacement&gt;*/
&nbsp;
/*&lt;replacement&gt;*/
var util = require('core-util-is');
util.inherits = require('inherits');
/*&lt;/replacement&gt;*/
&nbsp;
var Readable = require('./_stream_readable');
var Writable = require('./_stream_writable');
&nbsp;
util.inherits(Duplex, Readable);
&nbsp;
var keys = objectKeys(Writable.prototype);
for (var v = 0; v &lt; keys.length; v++) {
  var method = keys[v];
  if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
}
&nbsp;
function Duplex(options) {
  <span class="missing-if-branch" title="if path not taken" >I</span>if (!(this instanceof Duplex)) <span class="cstat-no" title="statement not covered" >return new Duplex(options);</span>
&nbsp;
  Readable.call(this, options);
  Writable.call(this, options);
&nbsp;
  <span class="missing-if-branch" title="if path not taken" >I</span>if (options &amp;&amp; options.readable === false) <span class="cstat-no" title="statement not covered" >this.readable = false;</span>
&nbsp;
  <span class="missing-if-branch" title="if path not taken" >I</span>if (options &amp;&amp; options.writable === false) <span class="cstat-no" title="statement not covered" >this.writable = false;</span>
&nbsp;
  this.allowHalfOpen = true;
  <span class="missing-if-branch" title="if path not taken" >I</span>if (options &amp;&amp; options.allowHalfOpen === false) <span class="cstat-no" title="statement not covered" >this.allowHalfOpen = false;</span>
&nbsp;
  this.once('end', onend);
}
&nbsp;
// the no-half-open enforcer
function onend() {
  // if we allow half-open state, or if the writable side ended,
  // then we're ok.
  <span class="missing-if-branch" title="else path not taken" >E</span>if (this.allowHalfOpen || <span class="branch-1 cbranch-no" title="branch not covered" >this._writableState.ended)</span> return;
&nbsp;
  // no more data can be written.
  // But allow more writes to happen in this tick.
<span class="cstat-no" title="statement not covered" >  processNextTick(onEndNT, this);</span>
}
&nbsp;
<span class="fstat-no" title="function not covered" >function onEndNT(self) {</span>
<span class="cstat-no" title="statement not covered" >  self.end();</span>
}
&nbsp;
<span class="fstat-no" title="function not covered" >function forEach(xs, f) {</span>
<span class="cstat-no" title="statement not covered" >  for (var i = 0, l = xs.length; i &lt; l; i++) {</span>
<span class="cstat-no" title="statement not covered" >    f(xs[i], i);</span>
  }
}</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</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 Wed May 18 2016 10:10:05 GMT-0400 (EDT)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="../sorter.js"></script>
</body>
</html>