PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 6ms RepoModel.GetById 34ms app.codeStats 0ms

/js/lib/Socket.IO-node/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-array-comprehension.js

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
JavaScript | 32 lines | 31 code | 0 blank | 1 comment | 11 complexity | c08744f2664979c35cae599fb2e85424 MD5 | raw file
 1/* automatically generated by JSCoverage - do not edit */
 2if (! top._$jscoverage) {
 3  top._$jscoverage = {};
 4}
 5var _$jscoverage = top._$jscoverage;
 6if (! _$jscoverage['javascript-array-comprehension.js']) {
 7  _$jscoverage['javascript-array-comprehension.js'] = [];
 8  _$jscoverage['javascript-array-comprehension.js'][3] = 0;
 9  _$jscoverage['javascript-array-comprehension.js'][4] = 0;
10  _$jscoverage['javascript-array-comprehension.js'][5] = 0;
11  _$jscoverage['javascript-array-comprehension.js'][8] = 0;
12  _$jscoverage['javascript-array-comprehension.js'][9] = 0;
13  _$jscoverage['javascript-array-comprehension.js'][12] = 0;
14  _$jscoverage['javascript-array-comprehension.js'][14] = 0;
15}
16_$jscoverage['javascript-array-comprehension.js'][3]++;
17function range(begin, end) {
18  _$jscoverage['javascript-array-comprehension.js'][4]++;
19  for (let i = begin; i < end; ++i) {
20    _$jscoverage['javascript-array-comprehension.js'][5]++;
21    yield i;
22}
23}
24_$jscoverage['javascript-array-comprehension.js'][8]++;
25var ten_squares = [i * i for each (i in range(0, 10))];
26_$jscoverage['javascript-array-comprehension.js'][9]++;
27var evens = [i for each (i in range(0, 21)) if (i % 2 == 0)];
28_$jscoverage['javascript-array-comprehension.js'][12]++;
29var optimized = [1 for each (i in x) if (0)];
30_$jscoverage['javascript-array-comprehension.js'][14]++;
31[i for each (a in x) for each (b in y)];
32_$jscoverage['javascript-array-comprehension.js'].source = ["<span class=\"c\">// https://developer.mozilla.org/en/New_in_JavaScript_1.7</span>","","<span class=\"k\">function</span> range<span class=\"k\">(</span>begin<span class=\"k\">,</span> end<span class=\"k\">)</span> <span class=\"k\">{</span>","  <span class=\"k\">for</span> <span class=\"k\">(</span><span class=\"k\">let</span> i <span class=\"k\">=</span> begin<span class=\"k\">;</span> i <span class=\"k\">&lt;</span> end<span class=\"k\">;</span> <span class=\"k\">++</span>i<span class=\"k\">)</span> <span class=\"k\">{</span>","    <span class=\"k\">yield</span> i<span class=\"k\">;</span>","  <span class=\"k\">}</span>","<span class=\"k\">}</span>","<span class=\"k\">var</span> ten_squares <span class=\"k\">=</span> <span class=\"k\">[</span>i <span class=\"k\">*</span> i <span class=\"k\">for</span> each <span class=\"k\">(</span>i <span class=\"k\">in</span> range<span class=\"k\">(</span><span class=\"s\">0</span><span class=\"k\">,</span> <span class=\"s\">10</span><span class=\"k\">))];</span>","<span class=\"k\">var</span> evens <span class=\"k\">=</span> <span class=\"k\">[</span>i <span class=\"k\">for</span> each <span class=\"k\">(</span>i <span class=\"k\">in</span> range<span class=\"k\">(</span><span class=\"s\">0</span><span class=\"k\">,</span> <span class=\"s\">21</span><span class=\"k\">))</span> <span class=\"k\">if</span> <span class=\"k\">(</span>i <span class=\"k\">%</span> <span class=\"s\">2</span> <span class=\"k\">==</span> <span class=\"s\">0</span><span class=\"k\">)];</span>","","<span class=\"c\">// test optimization</span>","<span class=\"k\">var</span> optimized <span class=\"k\">=</span> <span class=\"k\">[</span>i <span class=\"k\">for</span> each <span class=\"k\">(</span>i <span class=\"k\">in</span> x<span class=\"k\">)</span> <span class=\"k\">if</span> <span class=\"k\">(</span><span class=\"s\">0</span><span class=\"k\">)];</span>","","<span class=\"k\">[</span>i <span class=\"k\">for</span> each <span class=\"k\">(</span>a <span class=\"k\">in</span> x<span class=\"k\">)</span> <span class=\"k\">for</span> each <span class=\"k\">(</span>b <span class=\"k\">in</span> y<span class=\"k\">)]</span>"];