PageRenderTime 548ms CodeModel.GetById 81ms app.highlight 159ms RepoModel.GetById 275ms app.codeStats 1ms

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

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
JavaScript | 148 lines | 147 code | 0 blank | 1 comment | 7 complexity | 82ba495390f315d7ff4481e22f55491b 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-let.js']) {
  7  _$jscoverage['javascript-let.js'] = [];
  8  _$jscoverage['javascript-let.js'][5] = 0;
  9  _$jscoverage['javascript-let.js'][6] = 0;
 10  _$jscoverage['javascript-let.js'][11] = 0;
 11  _$jscoverage['javascript-let.js'][15] = 0;
 12  _$jscoverage['javascript-let.js'][16] = 0;
 13  _$jscoverage['javascript-let.js'][17] = 0;
 14  _$jscoverage['javascript-let.js'][20] = 0;
 15  _$jscoverage['javascript-let.js'][22] = 0;
 16  _$jscoverage['javascript-let.js'][23] = 0;
 17  _$jscoverage['javascript-let.js'][24] = 0;
 18  _$jscoverage['javascript-let.js'][26] = 0;
 19  _$jscoverage['javascript-let.js'][27] = 0;
 20  _$jscoverage['javascript-let.js'][28] = 0;
 21  _$jscoverage['javascript-let.js'][30] = 0;
 22  _$jscoverage['javascript-let.js'][33] = 0;
 23  _$jscoverage['javascript-let.js'][34] = 0;
 24  _$jscoverage['javascript-let.js'][35] = 0;
 25  _$jscoverage['javascript-let.js'][36] = 0;
 26  _$jscoverage['javascript-let.js'][37] = 0;
 27  _$jscoverage['javascript-let.js'][39] = 0;
 28  _$jscoverage['javascript-let.js'][42] = 0;
 29  _$jscoverage['javascript-let.js'][43] = 0;
 30  _$jscoverage['javascript-let.js'][45] = 0;
 31  _$jscoverage['javascript-let.js'][46] = 0;
 32  _$jscoverage['javascript-let.js'][48] = 0;
 33  _$jscoverage['javascript-let.js'][51] = 0;
 34  _$jscoverage['javascript-let.js'][52] = 0;
 35  _$jscoverage['javascript-let.js'][55] = 0;
 36  _$jscoverage['javascript-let.js'][56] = 0;
 37  _$jscoverage['javascript-let.js'][60] = 0;
 38  _$jscoverage['javascript-let.js'][64] = 0;
 39  _$jscoverage['javascript-let.js'][65] = 0;
 40  _$jscoverage['javascript-let.js'][69] = 0;
 41  _$jscoverage['javascript-let.js'][70] = 0;
 42  _$jscoverage['javascript-let.js'][71] = 0;
 43  _$jscoverage['javascript-let.js'][74] = 0;
 44  _$jscoverage['javascript-let.js'][75] = 0;
 45  _$jscoverage['javascript-let.js'][76] = 0;
 46  _$jscoverage['javascript-let.js'][78] = 0;
 47  _$jscoverage['javascript-let.js'][79] = 0;
 48}
 49_$jscoverage['javascript-let.js'][5]++;
 50let (x = x + 10, y = 12) {
 51  _$jscoverage['javascript-let.js'][6]++;
 52  print(x + y + "\n");
 53}
 54_$jscoverage['javascript-let.js'][11]++;
 55print(let(x = x + 10, y = 12) x + y + "<br>\n");
 56_$jscoverage['javascript-let.js'][15]++;
 57if (x > y) {
 58  {
 59    _$jscoverage['javascript-let.js'][16]++;
 60    let gamma = 12.7 + y;
 61    _$jscoverage['javascript-let.js'][17]++;
 62    i = gamma * x;
 63  }
 64}
 65_$jscoverage['javascript-let.js'][20]++;
 66var list = document.getElementById("list");
 67_$jscoverage['javascript-let.js'][22]++;
 68for (var i = 1; i <= 5; i++) {
 69  {
 70    _$jscoverage['javascript-let.js'][23]++;
 71    var item = document.createElement("LI");
 72    _$jscoverage['javascript-let.js'][24]++;
 73    item.appendChild(document.createTextNode("Item " + i));
 74    _$jscoverage['javascript-let.js'][26]++;
 75    let j = i;
 76    _$jscoverage['javascript-let.js'][27]++;
 77    item.onclick = (function (ev) {
 78  _$jscoverage['javascript-let.js'][28]++;
 79  alert("Item " + j + " is clicked.");
 80});
 81    _$jscoverage['javascript-let.js'][30]++;
 82    list.appendChild(item);
 83  }
 84}
 85_$jscoverage['javascript-let.js'][33]++;
 86function varTest() {
 87  _$jscoverage['javascript-let.js'][34]++;
 88  var x = 31;
 89  _$jscoverage['javascript-let.js'][35]++;
 90  if (true) {
 91    _$jscoverage['javascript-let.js'][36]++;
 92    var x = 71;
 93    _$jscoverage['javascript-let.js'][37]++;
 94    alert(x);
 95  }
 96  _$jscoverage['javascript-let.js'][39]++;
 97  alert(x);
 98}
 99_$jscoverage['javascript-let.js'][42]++;
100function letTest() {
101  _$jscoverage['javascript-let.js'][43]++;
102  var x = 31;
103  {
104    _$jscoverage['javascript-let.js'][45]++;
105    let x = 71;
106    _$jscoverage['javascript-let.js'][46]++;
107    alert(x);
108  }
109  _$jscoverage['javascript-let.js'][48]++;
110  alert(x);
111}
112_$jscoverage['javascript-let.js'][51]++;
113function letTests() {
114  _$jscoverage['javascript-let.js'][52]++;
115  var x = 10;
116  _$jscoverage['javascript-let.js'][55]++;
117  let (x = x + 20) {
118    _$jscoverage['javascript-let.js'][56]++;
119    alert(x);
120  }
121  _$jscoverage['javascript-let.js'][60]++;
122  alert(let(x = x + 20) x);
123  {
124    _$jscoverage['javascript-let.js'][64]++;
125    let x = x + 20;
126    _$jscoverage['javascript-let.js'][65]++;
127    alert(x);
128  }
129}
130_$jscoverage['javascript-let.js'][69]++;
131var x = "global";
132_$jscoverage['javascript-let.js'][70]++;
133var x = 42;
134_$jscoverage['javascript-let.js'][71]++;
135document.write(this.x + "<br>\n");
136_$jscoverage['javascript-let.js'][74]++;
137var i = 0;
138_$jscoverage['javascript-let.js'][75]++;
139for (let i = i; i < 10; i++) {
140  _$jscoverage['javascript-let.js'][76]++;
141  document.write(i + "<br>\n");
142}
143_$jscoverage['javascript-let.js'][78]++;
144for (let [name, value] in obj) {
145  _$jscoverage['javascript-let.js'][79]++;
146  document.write("Name: " + name + ", Value: " + value + "<br>\n");
147}
148_$jscoverage['javascript-let.js'].source = ["<span class=\"c\">// https://developer.mozilla.org/en/New_in_JavaScript_1.7</span>","","<span class=\"c\">// let statement</span>","","<span class=\"k\">let</span> <span class=\"k\">(</span>x <span class=\"k\">=</span> x<span class=\"k\">+</span><span class=\"s\">10</span><span class=\"k\">,</span> y <span class=\"k\">=</span> <span class=\"s\">12</span><span class=\"k\">)</span> <span class=\"k\">{</span>","  print<span class=\"k\">(</span>x<span class=\"k\">+</span>y <span class=\"k\">+</span> <span class=\"s\">\"</span><span class=\"t\">\\n</span><span class=\"s\">\"</span><span class=\"k\">);</span>","<span class=\"k\">}</span>","","<span class=\"c\">// let expressions</span>","","print<span class=\"k\">(</span> <span class=\"k\">let</span><span class=\"k\">(</span>x <span class=\"k\">=</span> x <span class=\"k\">+</span> <span class=\"s\">10</span><span class=\"k\">,</span> y <span class=\"k\">=</span> <span class=\"s\">12</span><span class=\"k\">)</span> x<span class=\"k\">+</span>y  <span class=\"k\">+</span> <span class=\"s\">\"&lt;br&gt;</span><span class=\"t\">\\n</span><span class=\"s\">\"</span><span class=\"k\">);</span>","","<span class=\"c\">// let definitions</span>","","<span class=\"k\">if</span> <span class=\"k\">(</span>x <span class=\"k\">&gt;</span> y<span class=\"k\">)</span> <span class=\"k\">{</span>","  <span class=\"k\">let</span> gamma <span class=\"k\">=</span> <span class=\"s\">12.7</span> <span class=\"k\">+</span> y<span class=\"k\">;</span>","  i <span class=\"k\">=</span> gamma <span class=\"k\">*</span> x<span class=\"k\">;</span>","<span class=\"k\">}</span>","","<span class=\"k\">var</span> list <span class=\"k\">=</span> document<span class=\"k\">.</span>getElementById<span class=\"k\">(</span><span class=\"s\">\"list\"</span><span class=\"k\">);</span>","","<span class=\"k\">for</span> <span class=\"k\">(</span><span class=\"k\">var</span> i <span class=\"k\">=</span> <span class=\"s\">1</span><span class=\"k\">;</span> i <span class=\"k\">&lt;=</span> <span class=\"s\">5</span><span class=\"k\">;</span> i<span class=\"k\">++)</span> <span class=\"k\">{</span>","  <span class=\"k\">var</span> item <span class=\"k\">=</span> document<span class=\"k\">.</span>createElement<span class=\"k\">(</span><span class=\"s\">\"LI\"</span><span class=\"k\">);</span>","  item<span class=\"k\">.</span>appendChild<span class=\"k\">(</span>document<span class=\"k\">.</span>createTextNode<span class=\"k\">(</span><span class=\"s\">\"Item \"</span> <span class=\"k\">+</span> i<span class=\"k\">));</span>","","  <span class=\"k\">let</span> j <span class=\"k\">=</span> i<span class=\"k\">;</span>","  item<span class=\"k\">.</span>onclick <span class=\"k\">=</span> <span class=\"k\">function</span> <span class=\"k\">(</span>ev<span class=\"k\">)</span> <span class=\"k\">{</span>","    alert<span class=\"k\">(</span><span class=\"s\">\"Item \"</span> <span class=\"k\">+</span> j <span class=\"k\">+</span> <span class=\"s\">\" is clicked.\"</span><span class=\"k\">);</span>","  <span class=\"k\">}</span><span class=\"k\">;</span>","  list<span class=\"k\">.</span>appendChild<span class=\"k\">(</span>item<span class=\"k\">);</span>","<span class=\"k\">}</span>","","<span class=\"k\">function</span> varTest<span class=\"k\">()</span> <span class=\"k\">{</span>","  <span class=\"k\">var</span> x <span class=\"k\">=</span> <span class=\"s\">31</span><span class=\"k\">;</span>","  <span class=\"k\">if</span> <span class=\"k\">(</span><span class=\"k\">true</span><span class=\"k\">)</span> <span class=\"k\">{</span>","    <span class=\"k\">var</span> x <span class=\"k\">=</span> <span class=\"s\">71</span><span class=\"k\">;</span>  <span class=\"c\">// same variable!</span>","    alert<span class=\"k\">(</span>x<span class=\"k\">);</span>  <span class=\"c\">// 71</span>","  <span class=\"k\">}</span>","  alert<span class=\"k\">(</span>x<span class=\"k\">);</span>  <span class=\"c\">// 71</span>","<span class=\"k\">}</span>","","<span class=\"k\">function</span> letTest<span class=\"k\">()</span> <span class=\"k\">{</span>","  <span class=\"k\">let</span> x <span class=\"k\">=</span> <span class=\"s\">31</span><span class=\"k\">;</span>","  <span class=\"k\">if</span> <span class=\"k\">(</span><span class=\"k\">true</span><span class=\"k\">)</span> <span class=\"k\">{</span>","    <span class=\"k\">let</span> x <span class=\"k\">=</span> <span class=\"s\">71</span><span class=\"k\">;</span>  <span class=\"c\">// different variable</span>","    alert<span class=\"k\">(</span>x<span class=\"k\">);</span>  <span class=\"c\">// 71</span>","  <span class=\"k\">}</span>","  alert<span class=\"k\">(</span>x<span class=\"k\">);</span>  <span class=\"c\">// 31</span>","<span class=\"k\">}</span>","","<span class=\"k\">function</span> letTests<span class=\"k\">()</span> <span class=\"k\">{</span>","  <span class=\"k\">let</span> x <span class=\"k\">=</span> <span class=\"s\">10</span><span class=\"k\">;</span>","","  <span class=\"c\">// let-statement</span>","  <span class=\"k\">let</span> <span class=\"k\">(</span>x <span class=\"k\">=</span> x <span class=\"k\">+</span> <span class=\"s\">20</span><span class=\"k\">)</span> <span class=\"k\">{</span>","    alert<span class=\"k\">(</span>x<span class=\"k\">);</span>  <span class=\"c\">// 30</span>","  <span class=\"k\">}</span>","","  <span class=\"c\">// let-expression</span>","  alert<span class=\"k\">(</span><span class=\"k\">let</span> <span class=\"k\">(</span>x <span class=\"k\">=</span> x <span class=\"k\">+</span> <span class=\"s\">20</span><span class=\"k\">)</span> x<span class=\"k\">);</span>  <span class=\"c\">// 30</span>","","  <span class=\"c\">// let-definition</span>","  <span class=\"k\">{</span>","    <span class=\"k\">let</span> x <span class=\"k\">=</span> x <span class=\"k\">+</span> <span class=\"s\">20</span><span class=\"k\">;</span>  <span class=\"c\">// x here evaluates to undefined</span>","    alert<span class=\"k\">(</span>x<span class=\"k\">);</span>  <span class=\"c\">// undefined + 20 ==&gt; NaN</span>","  <span class=\"k\">}</span>","<span class=\"k\">}</span>","","<span class=\"k\">var</span> x <span class=\"k\">=</span> <span class=\"s\">'global'</span><span class=\"k\">;</span>","<span class=\"k\">let</span> x <span class=\"k\">=</span> <span class=\"s\">42</span><span class=\"k\">;</span>","document<span class=\"k\">.</span>write<span class=\"k\">(</span><span class=\"k\">this</span><span class=\"k\">.</span>x <span class=\"k\">+</span> <span class=\"s\">\"&lt;br&gt;</span><span class=\"t\">\\n</span><span class=\"s\">\"</span><span class=\"k\">);</span>","","<span class=\"c\">// let-scoped variables in for loops</span>","<span class=\"k\">var</span> i<span class=\"k\">=</span><span class=\"s\">0</span><span class=\"k\">;</span>","<span class=\"k\">for</span> <span class=\"k\">(</span> <span class=\"k\">let</span> i<span class=\"k\">=</span>i <span class=\"k\">;</span> i <span class=\"k\">&lt;</span> <span class=\"s\">10</span> <span class=\"k\">;</span> i<span class=\"k\">++</span> <span class=\"k\">)</span>","  document<span class=\"k\">.</span>write<span class=\"k\">(</span>i <span class=\"k\">+</span> <span class=\"s\">\"&lt;br&gt;</span><span class=\"t\">\\n</span><span class=\"s\">\"</span><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> obj <span class=\"k\">)</span>","  document<span class=\"k\">.</span>write<span class=\"k\">(</span><span class=\"s\">\"Name: \"</span> <span class=\"k\">+</span> name <span class=\"k\">+</span> <span class=\"s\">\", Value: \"</span> <span class=\"k\">+</span> value <span class=\"k\">+</span> <span class=\"s\">\"&lt;br&gt;</span><span class=\"t\">\\n</span><span class=\"s\">\"</span><span class=\"k\">);</span>"];