PageRenderTime 103ms CodeModel.GetById 60ms app.highlight 13ms RepoModel.GetById 28ms app.codeStats 0ms

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

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
JavaScript | 96 lines | 95 code | 0 blank | 1 comment | 5 complexity | 7ecfff4ea6bd10fa8c19b37638ad0e25 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-destructuring.js']) {
 7  _$jscoverage['javascript-destructuring.js'] = [];
 8  _$jscoverage['javascript-destructuring.js'][3] = 0;
 9  _$jscoverage['javascript-destructuring.js'][5] = 0;
10  _$jscoverage['javascript-destructuring.js'][6] = 0;
11  _$jscoverage['javascript-destructuring.js'][8] = 0;
12  _$jscoverage['javascript-destructuring.js'][10] = 0;
13  _$jscoverage['javascript-destructuring.js'][11] = 0;
14  _$jscoverage['javascript-destructuring.js'][12] = 0;
15  _$jscoverage['javascript-destructuring.js'][15] = 0;
16  _$jscoverage['javascript-destructuring.js'][16] = 0;
17  _$jscoverage['javascript-destructuring.js'][17] = 0;
18  _$jscoverage['javascript-destructuring.js'][20] = 0;
19  _$jscoverage['javascript-destructuring.js'][21] = 0;
20  _$jscoverage['javascript-destructuring.js'][23] = 0;
21  _$jscoverage['javascript-destructuring.js'][24] = 0;
22  _$jscoverage['javascript-destructuring.js'][25] = 0;
23  _$jscoverage['javascript-destructuring.js'][26] = 0;
24  _$jscoverage['javascript-destructuring.js'][27] = 0;
25  _$jscoverage['javascript-destructuring.js'][30] = 0;
26  _$jscoverage['javascript-destructuring.js'][31] = 0;
27  _$jscoverage['javascript-destructuring.js'][32] = 0;
28  _$jscoverage['javascript-destructuring.js'][35] = 0;
29  _$jscoverage['javascript-destructuring.js'][37] = 0;
30  _$jscoverage['javascript-destructuring.js'][38] = 0;
31  _$jscoverage['javascript-destructuring.js'][39] = 0;
32  _$jscoverage['javascript-destructuring.js'][40] = 0;
33  _$jscoverage['javascript-destructuring.js'][41] = 0;
34}
35_$jscoverage['javascript-destructuring.js'][3]++;
36[a, b] = [b, a];
37_$jscoverage['javascript-destructuring.js'][5]++;
38function f() {
39  _$jscoverage['javascript-destructuring.js'][6]++;
40  return [1, 2];
41}
42_$jscoverage['javascript-destructuring.js'][8]++;
43[a, b] = f();
44_$jscoverage['javascript-destructuring.js'][10]++;
45for (let [name, value] in Iterator(obj)) {
46  _$jscoverage['javascript-destructuring.js'][11]++;
47  print(name);
48  _$jscoverage['javascript-destructuring.js'][12]++;
49  print(value);
50}
51_$jscoverage['javascript-destructuring.js'][15]++;
52for each (let {name: n, family: {father: f}} in people) {
53  _$jscoverage['javascript-destructuring.js'][16]++;
54  print(n);
55  _$jscoverage['javascript-destructuring.js'][17]++;
56  print(f);
57}
58_$jscoverage['javascript-destructuring.js'][20]++;
59var [a, , b] = f();
60_$jscoverage['javascript-destructuring.js'][21]++;
61[, , ,] = f();
62_$jscoverage['javascript-destructuring.js'][23]++;
63function g() {
64  _$jscoverage['javascript-destructuring.js'][24]++;
65  var parsedURL = /^(\w+)\:\/\/([^\/]+)\/(.*)$/.exec(url);
66  _$jscoverage['javascript-destructuring.js'][25]++;
67  if (! parsedURL) {
68    _$jscoverage['javascript-destructuring.js'][26]++;
69    return null;
70  }
71  _$jscoverage['javascript-destructuring.js'][27]++;
72  var [, protocol, fullhost, fullpath] = parsedURL;
73}
74_$jscoverage['javascript-destructuring.js'][30]++;
75function h(a, [b, c], {foo: d, "bar": e}) {
76  _$jscoverage['javascript-destructuring.js'][31]++;
77  f();
78  _$jscoverage['javascript-destructuring.js'][32]++;
79  g();
80}
81_$jscoverage['javascript-destructuring.js'][35]++;
82x = (function ([a, b]) {
83  return a + b;
84});
85_$jscoverage['javascript-destructuring.js'][37]++;
86({x: x0, y: y0}) = point;
87_$jscoverage['javascript-destructuring.js'][38]++;
88var {x: x0, y: y0} = point;
89_$jscoverage['javascript-destructuring.js'][39]++;
90let ({x: x0, y: y0} = point) {
91  _$jscoverage['javascript-destructuring.js'][40]++;
92  print(x0);
93  _$jscoverage['javascript-destructuring.js'][41]++;
94  print(y0);
95}
96_$jscoverage['javascript-destructuring.js'].source = ["<span class=\"c\">// https://developer.mozilla.org/en/New_in_JavaScript_1.7</span>","","<span class=\"k\">[</span>a<span class=\"k\">,</span> b<span class=\"k\">]</span> <span class=\"k\">=</span> <span class=\"k\">[</span>b<span class=\"k\">,</span> a<span class=\"k\">];</span>","","<span class=\"k\">function</span> f<span class=\"k\">()</span> <span class=\"k\">{</span>","  <span class=\"k\">return</span> <span class=\"k\">[</span><span class=\"s\">1</span><span class=\"k\">,</span> <span class=\"s\">2</span><span class=\"k\">];</span>","<span class=\"k\">}</span>","<span class=\"k\">[</span>a<span class=\"k\">,</span> b<span class=\"k\">]</span> <span class=\"k\">=</span> f<span class=\"k\">();</span>","","<span class=\"k\">for</span> <span class=\"k\">(</span><span class=\"k\">let</span> <span class=\"k\">[</span>name<span class=\"k\">,</span> value<span class=\"k\">]</span> <span class=\"k\">in</span> Iterator<span class=\"k\">(</span>obj<span class=\"k\">))</span> <span class=\"k\">{</span>","  print<span class=\"k\">(</span>name<span class=\"k\">);</span>","  print<span class=\"k\">(</span>value<span class=\"k\">);</span>","<span class=\"k\">}</span>","","<span class=\"k\">for</span> each <span class=\"k\">(</span><span class=\"k\">let</span> <span class=\"k\">{</span>name<span class=\"k\">:</span> n<span class=\"k\">,</span> family<span class=\"k\">:</span> <span class=\"k\">{</span> father<span class=\"k\">:</span> f <span class=\"k\">}</span> <span class=\"k\">}</span> <span class=\"k\">in</span> people<span class=\"k\">)</span> <span class=\"k\">{</span>","  print<span class=\"k\">(</span>n<span class=\"k\">);</span>","  print<span class=\"k\">(</span>f<span class=\"k\">);</span>","<span class=\"k\">}</span>","","<span class=\"k\">var</span> <span class=\"k\">[</span>a<span class=\"k\">,</span> <span class=\"k\">,</span> b<span class=\"k\">]</span> <span class=\"k\">=</span> f<span class=\"k\">();</span>","<span class=\"k\">[,,,]</span> <span class=\"k\">=</span> f<span class=\"k\">();</span>","","<span class=\"k\">function</span> g<span class=\"k\">()</span> <span class=\"k\">{</span>","  <span class=\"k\">var</span> parsedURL <span class=\"k\">=</span> <span class=\"s\">/^(\\w+)\\:\\/\\/([^\\/]+)\\/(.*)$/</span><span class=\"k\">.</span>exec<span class=\"k\">(</span>url<span class=\"k\">);</span>","  <span class=\"k\">if</span> <span class=\"k\">(!</span>parsedURL<span class=\"k\">)</span>","    <span class=\"k\">return</span> <span class=\"k\">null</span><span class=\"k\">;</span>","  <span class=\"k\">var</span> <span class=\"k\">[,</span> protocol<span class=\"k\">,</span> fullhost<span class=\"k\">,</span> fullpath<span class=\"k\">]</span> <span class=\"k\">=</span> parsedURL<span class=\"k\">;</span>","<span class=\"k\">}</span>","","<span class=\"k\">function</span> h<span class=\"k\">(</span>a<span class=\"k\">,</span> <span class=\"k\">[</span>b<span class=\"k\">,</span> c<span class=\"k\">],</span> <span class=\"k\">{</span>foo<span class=\"k\">:</span> d<span class=\"k\">,</span> <span class=\"s\">'bar'</span><span class=\"k\">:</span> e<span class=\"k\">}</span><span class=\"k\">)</span> <span class=\"k\">{</span>","  f<span class=\"k\">();</span>","  g<span class=\"k\">();</span>","<span class=\"k\">}</span>","","x <span class=\"k\">=</span> <span class=\"k\">function</span><span class=\"k\">([</span>a<span class=\"k\">,</span> b<span class=\"k\">])</span> a <span class=\"k\">+</span> b<span class=\"k\">;</span>","","<span class=\"k\">(</span><span class=\"k\">{</span>x<span class=\"k\">:</span> x0<span class=\"k\">,</span> y<span class=\"k\">:</span> y0<span class=\"k\">}</span><span class=\"k\">)</span> <span class=\"k\">=</span> point<span class=\"k\">;</span>","<span class=\"k\">var</span> <span class=\"k\">{</span>x<span class=\"k\">:</span> x0<span class=\"k\">,</span> y<span class=\"k\">:</span> y0<span class=\"k\">}</span> <span class=\"k\">=</span> point<span class=\"k\">;</span>","<span class=\"k\">let</span> <span class=\"k\">(</span><span class=\"k\">{</span>x<span class=\"k\">:</span> x0<span class=\"k\">,</span> y<span class=\"k\">:</span> y0<span class=\"k\">}</span> <span class=\"k\">=</span> point<span class=\"k\">)</span> <span class=\"k\">{</span>","  print<span class=\"k\">(</span>x0<span class=\"k\">);</span>","  print<span class=\"k\">(</span>y0<span class=\"k\">);</span>","<span class=\"k\">}</span>"];