temp.js 96 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906
  1. JavaScript debugger enabled
  2. /* 1 */ $compiledmod = function() {
  3. /* 2 */ var $scope120 = (function($modname) {
  4. /* 3 */ var $loadname130, $loadname132, $loadname133, $loadname132, $loadname133, $lattr134, $loadname136, $loadname137, $loadname136, $loadname137, $lattr138;
  5. /* 4 */ var $wakeFromSuspension = function() {
  6. /* 5 */ var susp = $scope120.$wakingSuspension;
  7. /* 6 */ delete $scope120.$wakingSuspension;
  8. /* 7 */ $blk = susp.$blk;
  9. /* 8 */ $loc = susp.$loc;
  10. /* 9 */ $gbl = susp.$gbl;
  11. /* 10 */ $exc = susp.$exc;
  12. /* 11 */ $err = susp.$err;
  13. /* 12 */ $currLineNo = susp.$lineno;
  14. /* 13 */ $currColNo = susp.$colno;
  15. /* 14 */ Sk.lastYield = Date.now();
  16. /* 15 */ $loadname130 = susp.$tmps.$loadname130;
  17. /* 16 */ $loadname132 = susp.$tmps.$loadname132;
  18. /* 17 */ $loadname133 = susp.$tmps.$loadname133;
  19. /* 18 */ $lattr134 = susp.$tmps.$lattr134;
  20. /* 19 */ $loadname136 = susp.$tmps.$loadname136;
  21. /* 20 */ $loadname137 = susp.$tmps.$loadname137;
  22. /* 21 */ $lattr138 = susp.$tmps.$lattr138;
  23. /* 22 */ try {
  24. /* 23 */ $ret = susp.child.resume();
  25. /* 24 */ } catch (err) {
  26. /* 25 */ if (!(err instanceof Sk.builtin.BaseException)) {
  27. /* 26 */ err = new Sk.builtin.ExternalError(err);
  28. /* 27 */ }
  29. /* 28 */ err.traceback.push({
  30. /* 29 */ lineno: $currLineNo,
  31. /* 30 */ colno: $currColNo,
  32. /* 31 */ filename: './my_test.py'
  33. /* 32 */ });
  34. /* 33 */ if ($exc.length > 0) {
  35. /* 34 */ $err = err;
  36. /* 35 */ $blk = $exc.pop();
  37. /* 36 */ } else {
  38. /* 37 */ throw err;
  39. /* 38 */ }
  40. /* 39 */ }
  41. /* 40 */ };
  42. /* 41 */ var $saveSuspension = function($child, $filename, $lineno, $colno) {
  43. /* 42 */ var susp = new Sk.misceval.Suspension();
  44. /* 43 */ susp.child = $child;
  45. /* 44 */ susp.resume = function() {
  46. /* 45 */ $scope120.$wakingSuspension = susp;
  47. /* 46 */ return $scope120();
  48. /* 47 */ };
  49. /* 48 */ susp.data = susp.child.data;
  50. /* 49 */ susp.$blk = $blk;
  51. /* 50 */ susp.$loc = $loc;
  52. /* 51 */ susp.$gbl = $gbl;
  53. /* 52 */ susp.$exc = $exc;
  54. /* 53 */ susp.$err = $err;
  55. /* 54 */ susp.$filename = $filename;
  56. /* 55 */ susp.$lineno = $lineno;
  57. /* 56 */ susp.$colno = $colno;
  58. /* 57 */ susp.optional = susp.child.optional;
  59. /* 58 */ susp.$tmps = {
  60. /* 59 */ "$loadname130": $loadname130,
  61. /* 60 */ "$loadname132": $loadname132,
  62. /* 61 */ "$loadname133": $loadname133,
  63. /* 62 */ "$lattr134": $lattr134,
  64. /* 63 */ "$loadname136": $loadname136,
  65. /* 64 */ "$loadname137": $loadname137,
  66. /* 65 */ "$lattr138": $lattr138
  67. /* 66 */ };
  68. /* 67 */ return susp;
  69. /* 68 */ };
  70. /* 69 */ var $gbl = {},
  71. /* 70 */ $blk = 0,
  72. /* 71 */ $exc = [],
  73. /* 72 */ $loc = $gbl,
  74. /* 73 */ $err = undefined;
  75. /* 74 */ $gbl.__name__ = $modname;
  76. /* 75 */ $loc.__file__ = new Sk.builtins.str('./my_test.py');
  77. /* 76 */ var $ret = undefined,
  78. /* 77 */ $currLineNo = undefined,
  79. /* 78 */ $currColNo = undefined;
  80. /* 79 */ if (typeof Sk.execStart === 'undefined') {
  81. /* 80 */ Sk.execStart = Date.now()
  82. /* 81 */ }
  83. /* 82 */ if (typeof Sk.lastYield === 'undefined') {
  84. /* 83 */ Sk.lastYield = Date.now()
  85. /* 84 */ }
  86. /* 85 */ if ($scope120.$wakingSuspension !== undefined) {
  87. /* 86 */ $wakeFromSuspension();
  88. /* 87 */ }
  89. /* 88 */ if (Sk.retainGlobals) {
  90. /* 89 */ if (Sk.globals) {
  91. /* 90 */ $gbl = Sk.globals;
  92. /* 91 */ Sk.globals = $gbl;
  93. /* 92 */ $loc = $gbl;
  94. /* 93 */ } else {
  95. /* 94 */ Sk.globals = $gbl;
  96. /* 95 */ }
  97. /* 96 */ } else {
  98. /* 97 */ Sk.globals = $gbl;
  99. /* 98 */ }
  100. /* 99 */ while (true) {
  101. /* 100 */ try {
  102. /* 101 */ var $dateNow = Date.now();
  103. /* 102 */ if ($dateNow - Sk.execStart > Sk.execLimit) {
  104. /* 103 */ throw new Sk.builtin.TimeLimitError(Sk.timeoutMsg())
  105. /* 104 */ }
  106. /* 105 */ if ($dateNow - Sk.lastYield > Sk.yieldLimit) {
  107. /* 106 */ var $susp = $saveSuspension({
  108. /* 107 */ data: {
  109. /* 108 */ type: 'Sk.yield'
  110. /* 109 */ },
  111. /* 110 */ resume: function() {}
  112. /* 111 */ }, './my_test.py', $currLineNo, $currColNo);
  113. /* 112 */ $susp.$blk = $blk;
  114. /* 113 */ $susp.optional = true;
  115. /* 114 */ return $susp;
  116. /* 115 */ }
  117. /* 116 */ switch ($blk) {
  118. /* 117 */ case 0:
  119. /* 118 */ /* --- module entry --- */
  120. /* 119 */ //
  121. /* 120 */ // line 1:
  122. /* 121 */ // class TestClass():
  123. /* 122 */ // ^
  124. /* 123 */ //
  125. /* 124 */ Sk.currLineNo = 1;
  126. /* 125 */ Sk.currColNo = 0;
  127. /* 126 */
  128. /* 127 */
  129. /* 128 */ Sk.currFilename = './my_test.py';
  130. /* 129 */
  131. /* 130 */
  132. /* 131 */ if (typeof Sk.afterSingleExecution == 'function') {
  133. /* 132 */ Sk.afterSingleExecution($gbl, Sk.currLineNo, Sk.currColNo, Sk.currFilename, 'ClassDef', {
  134. /* 133 */ "name": {
  135. /* 134 */ "v": "TestClass"
  136. /* 135 */ },
  137. /* 136 */ "bases": [],
  138. /* 137 */ "body": [{
  139. /* 138 */ "name": {
  140. /* 139 */ "v": "__getattr__"
  141. /* 140 */ },
  142. /* 141 */ "args": {
  143. /* 142 */ "args": [{
  144. /* 143 */ "id": {
  145. /* 144 */ "v": "self"
  146. /* 145 */ },
  147. /* 146 */ "lineno": 2,
  148. /* 147 */ "col_offset": 20,
  149. /* 148 */ "endlineno": 2,
  150. /* 149 */ "col_endoffset": 24},
  151. /* 150 */ {
  152. /* 151 */ "id": {
  153. /* 152 */ "v": "key"
  154. /* 153 */ },
  155. /* 154 */ "lineno": 2,
  156. /* 155 */ "col_offset": 26,
  157. /* 156 */ "endlineno": 2,
  158. /* 157 */ "col_endoffset": 24}],
  159. /* 158 */ "vararg": null,
  160. /* 159 */ "kwarg": null,
  161. /* 160 */ "defaults": []
  162. /* 161 */ },
  163. /* 162 */ "body": [{
  164. /* 163 */ "test": {
  165. /* 164 */ "left": {
  166. /* 165 */ "id": {
  167. /* 166 */ "v": "key"
  168. /* 167 */ },
  169. /* 168 */ "lineno": 3,
  170. /* 169 */ "col_offset": 11,
  171. /* 170 */ "endlineno": 3,
  172. /* 171 */ "col_endoffset": 14
  173. /* 172 */ },
  174. /* 173 */ "ops": [null],
  175. /* 174 */ "comparators": [{
  176. /* 175 */ "s": {
  177. /* 176 */ "v": "t"
  178. /* 177 */ },
  179. /* 178 */ "lineno": 3,
  180. /* 179 */ "col_offset": 18,
  181. /* 180 */ "endlineno": 3,
  182. /* 181 */ "col_endoffset": 21}],
  183. /* 182 */ "lineno": 3,
  184. /* 183 */ "col_offset": 11,
  185. /* 184 */ "endlineno": 3,
  186. /* 185 */ "col_endoffset": 14
  187. /* 186 */ },
  188. /* 187 */ "body": [{
  189. /* 188 */ "value": {
  190. /* 189 */ "n": {
  191. /* 190 */ "v": 5
  192. /* 191 */ },
  193. /* 192 */ "lineno": 4,
  194. /* 193 */ "col_offset": 19,
  195. /* 194 */ "endlineno": 4,
  196. /* 195 */ "col_endoffset": 20
  197. /* 196 */ },
  198. /* 197 */ "lineno": 4,
  199. /* 198 */ "col_offset": 12,
  200. /* 199 */ "endlineno": 4,
  201. /* 200 */ "col_endoffset": 18}],
  202. /* 201 */ "orelse": [],
  203. /* 202 */ "lineno": 3,
  204. /* 203 */ "col_offset": 8,
  205. /* 204 */ "endlineno": 3,
  206. /* 205 */ "col_endoffset": 10}],
  207. /* 206 */ "decorator_list": [],
  208. /* 207 */ "lineno": 2,
  209. /* 208 */ "col_offset": 4,
  210. /* 209 */ "endlineno": 2,
  211. /* 210 */ "col_endoffset": 7,
  212. /* 211 */ "scopeId": 20}],
  213. /* 212 */ "decorator_list": [],
  214. /* 213 */ "lineno": 1,
  215. /* 214 */ "col_offset": 0,
  216. /* 215 */ "endlineno": 1,
  217. /* 216 */ "col_endoffset": 5,
  218. /* 217 */ "scopeId": 19
  219. /* 218 */ });
  220. /* 219 */ }
  221. /* 220 */ currLineNo = 1;
  222. /* 221 */ currColNo = 0;
  223. /* 222 */
  224. /* 223 */ $scope121.co_name = new Sk.builtins['str']('TestClass');
  225. /* 224 */ var $built129 = Sk.misceval.buildClass($gbl, $scope121, 'TestClass', []);
  226. /* 225 */ $loc.TestClass = $built129;
  227. /* 226 */ //
  228. /* 227 */ // line 5:
  229. /* 228 */ // t = TestClass()
  230. /* 229 */ // ^
  231. /* 230 */ //
  232. /* 231 */ Sk.currLineNo = 5;
  233. /* 232 */ Sk.currColNo = 0;
  234. /* 233 */
  235. /* 234 */
  236. /* 235 */ Sk.currFilename = './my_test.py';
  237. /* 236 */
  238. /* 237 */
  239. /* 238 */ if (typeof Sk.afterSingleExecution == 'function') {
  240. /* 239 */ Sk.afterSingleExecution($gbl, Sk.currLineNo, Sk.currColNo, Sk.currFilename, 'Assign', {
  241. /* 240 */ "targets": [{
  242. /* 241 */ "id": {
  243. /* 242 */ "v": "t"
  244. /* 243 */ },
  245. /* 244 */ "lineno": 5,
  246. /* 245 */ "col_offset": 0,
  247. /* 246 */ "endlineno": 5,
  248. /* 247 */ "col_endoffset": 1}],
  249. /* 248 */ "value": {
  250. /* 249 */ "func": {
  251. /* 250 */ "id": {
  252. /* 251 */ "v": "TestClass"
  253. /* 252 */ },
  254. /* 253 */ "lineno": 5,
  255. /* 254 */ "col_offset": 4,
  256. /* 255 */ "endlineno": 5,
  257. /* 256 */ "col_endoffset": 13
  258. /* 257 */ },
  259. /* 258 */ "args": [],
  260. /* 259 */ "keywords": [],
  261. /* 260 */ "starargs": null,
  262. /* 261 */ "kwargs": null,
  263. /* 262 */ "lineno": 5,
  264. /* 263 */ "col_offset": 4,
  265. /* 264 */ "endlineno": 5,
  266. /* 265 */ "col_endoffset": 13
  267. /* 266 */ },
  268. /* 267 */ "lineno": 5,
  269. /* 268 */ "col_offset": 0,
  270. /* 269 */ "endlineno": 5,
  271. /* 270 */ "col_endoffset": 1
  272. /* 271 */ });
  273. /* 272 */ }
  274. /* 273 */ currLineNo = 5;
  275. /* 274 */ currColNo = 0;
  276. /* 275 */
  277. /* 276 */ var $loadname130 = $loc.TestClass !== undefined ? $loc.TestClass : Sk.misceval.loadname('TestClass', $gbl);;
  278. /* 277 */ $ret;
  279. /* 278 */ $ret = Sk.misceval.callsimOrSuspend($loadname130);
  280. /* 279 */ $blk = 1; /* allowing case fallthrough */
  281. /* 280 */ case 1:
  282. /* 281 */ /* --- function return or resume suspension --- */
  283. /* 282 */ if ($ret && $ret.$isSuspension) {
  284. /* 283 */ return $saveSuspension($ret, './my_test.py', 5, 4);
  285. /* 284 */ }
  286. /* 285 */ var $call131 = $ret;
  287. /* 286 */ //
  288. /* 287 */ // line 5:
  289. /* 288 */ // t = TestClass()
  290. /* 289 */ // ^
  291. /* 290 */ //
  292. /* 291 */ Sk.currLineNo = 5;
  293. /* 292 */ Sk.currColNo = 4;
  294. /* 293 */
  295. /* 294 */
  296. /* 295 */ Sk.currFilename = './my_test.py';
  297. /* 296 */
  298. /* 297 */ currLineNo = 5;
  299. /* 298 */ currColNo = 4;
  300. /* 299 */
  301. /* 300 */ $loc.t = $call131;
  302. /* 301 */ //
  303. /* 302 */ // line 6:
  304. /* 303 */ // print(t.t)
  305. /* 304 */ // ^
  306. /* 305 */ //
  307. /* 306 */ Sk.currLineNo = 6;
  308. /* 307 */ Sk.currColNo = 0;
  309. /* 308 */
  310. /* 309 */
  311. /* 310 */ Sk.currFilename = './my_test.py';
  312. /* 311 */
  313. /* 312 */
  314. /* 313 */ if (typeof Sk.afterSingleExecution == 'function') {
  315. /* 314 */ Sk.afterSingleExecution($gbl, Sk.currLineNo, Sk.currColNo, Sk.currFilename, 'Expr', {
  316. /* 315 */ "value": {
  317. /* 316 */ "func": {
  318. /* 317 */ "id": {
  319. /* 318 */ "v": "print"
  320. /* 319 */ },
  321. /* 320 */ "lineno": 6,
  322. /* 321 */ "col_offset": 0,
  323. /* 322 */ "endlineno": 6,
  324. /* 323 */ "col_endoffset": 5
  325. /* 324 */ },
  326. /* 325 */ "args": [{
  327. /* 326 */ "value": {
  328. /* 327 */ "id": {
  329. /* 328 */ "v": "t"
  330. /* 329 */ },
  331. /* 330 */ "lineno": 6,
  332. /* 331 */ "col_offset": 6,
  333. /* 332 */ "endlineno": 6,
  334. /* 333 */ "col_endoffset": 7
  335. /* 334 */ },
  336. /* 335 */ "attr": {
  337. /* 336 */ "v": "t"
  338. /* 337 */ },
  339. /* 338 */ "lineno": 6,
  340. /* 339 */ "col_offset": 6,
  341. /* 340 */ "endlineno": 6,
  342. /* 341 */ "col_endoffset": 7}],
  343. /* 342 */ "keywords": [],
  344. /* 343 */ "starargs": null,
  345. /* 344 */ "kwargs": null,
  346. /* 345 */ "lineno": 6,
  347. /* 346 */ "col_offset": 0,
  348. /* 347 */ "endlineno": 6,
  349. /* 348 */ "col_endoffset": 5
  350. /* 349 */ },
  351. /* 350 */ "lineno": 6,
  352. /* 351 */ "col_offset": 0,
  353. /* 352 */ "endlineno": 6,
  354. /* 353 */ "col_endoffset": 5
  355. /* 354 */ });
  356. /* 355 */ }
  357. /* 356 */ currLineNo = 6;
  358. /* 357 */ currColNo = 0;
  359. /* 358 */
  360. /* 359 */ var $loadname132 = $loc.print !== undefined ? $loc.print : Sk.misceval.loadname('print', $gbl);;
  361. /* 360 */ var $loadname133 = $loc.t !== undefined ? $loc.t : Sk.misceval.loadname('t', $gbl);;
  362. /* 361 */ $ret = Sk.abstr.gattr($loadname133, 't', true);
  363. /* 362 */ $blk = 2; /* allowing case fallthrough */
  364. /* 363 */ case 2:
  365. /* 364 */ /* --- function return or resume suspension --- */
  366. /* 365 */ if ($ret && $ret.$isSuspension) {
  367. /* 366 */ return $saveSuspension($ret, './my_test.py', 6, 6);
  368. /* 367 */ }
  369. /* 368 */ var $lattr134 = $ret;
  370. /* 369 */ $ret;
  371. /* 370 */ $ret = Sk.misceval.callsimOrSuspend($loadname132, $lattr134);
  372. /* 371 */ $blk = 3; /* allowing case fallthrough */
  373. /* 372 */ case 3:
  374. /* 373 */ /* --- function return or resume suspension --- */
  375. /* 374 */ if ($ret && $ret.$isSuspension) {
  376. /* 375 */ return $saveSuspension($ret, './my_test.py', 6, 0);
  377. /* 376 */ }
  378. /* 377 */ var $call135 = $ret;
  379. /* 378 */ //
  380. /* 379 */ // line 6:
  381. /* 380 */ // print(t.t)
  382. /* 381 */ // ^
  383. /* 382 */ //
  384. /* 383 */ Sk.currLineNo = 6;
  385. /* 384 */ Sk.currColNo = 0;
  386. /* 385 */
  387. /* 386 */
  388. /* 387 */ Sk.currFilename = './my_test.py';
  389. /* 388 */
  390. /* 389 */ currLineNo = 6;
  391. /* 390 */ currColNo = 0;
  392. /* 391 */
  393. /* 392 */
  394. /* 393 */ //
  395. /* 394 */ // line 7:
  396. /* 395 */ // print(t.x)
  397. /* 396 */ // ^
  398. /* 397 */ //
  399. /* 398 */ Sk.currLineNo = 7;
  400. /* 399 */ Sk.currColNo = 0;
  401. /* 400 */
  402. /* 401 */
  403. /* 402 */ Sk.currFilename = './my_test.py';
  404. /* 403 */
  405. /* 404 */
  406. /* 405 */ if (typeof Sk.afterSingleExecution == 'function') {
  407. /* 406 */ Sk.afterSingleExecution($gbl, Sk.currLineNo, Sk.currColNo, Sk.currFilename, 'Expr', {
  408. /* 407 */ "value": {
  409. /* 408 */ "func": {
  410. /* 409 */ "id": {
  411. /* 410 */ "v": "print"
  412. /* 411 */ },
  413. /* 412 */ "lineno": 7,
  414. /* 413 */ "col_offset": 0,
  415. /* 414 */ "endlineno": 7,
  416. /* 415 */ "col_endoffset": 5
  417. /* 416 */ },
  418. /* 417 */ "args": [{
  419. /* 418 */ "value": {
  420. /* 419 */ "id": {
  421. /* 420 */ "v": "t"
  422. /* 421 */ },
  423. /* 422 */ "lineno": 7,
  424. /* 423 */ "col_offset": 6,
  425. /* 424 */ "endlineno": 7,
  426. /* 425 */ "col_endoffset": 7
  427. /* 426 */ },
  428. /* 427 */ "attr": {
  429. /* 428 */ "v": "x"
  430. /* 429 */ },
  431. /* 430 */ "lineno": 7,
  432. /* 431 */ "col_offset": 6,
  433. /* 432 */ "endlineno": 7,
  434. /* 433 */ "col_endoffset": 7}],
  435. /* 434 */ "keywords": [],
  436. /* 435 */ "starargs": null,
  437. /* 436 */ "kwargs": null,
  438. /* 437 */ "lineno": 7,
  439. /* 438 */ "col_offset": 0,
  440. /* 439 */ "endlineno": 7,
  441. /* 440 */ "col_endoffset": 5
  442. /* 441 */ },
  443. /* 442 */ "lineno": 7,
  444. /* 443 */ "col_offset": 0,
  445. /* 444 */ "endlineno": 7,
  446. /* 445 */ "col_endoffset": 5
  447. /* 446 */ });
  448. /* 447 */ }
  449. /* 448 */ currLineNo = 7;
  450. /* 449 */ currColNo = 0;
  451. /* 450 */
  452. /* 451 */ var $loadname136 = $loc.print !== undefined ? $loc.print : Sk.misceval.loadname('print', $gbl);;
  453. /* 452 */ var $loadname137 = $loc.t !== undefined ? $loc.t : Sk.misceval.loadname('t', $gbl);;
  454. /* 453 */ $ret = Sk.abstr.gattr($loadname137, 'x', true);
  455. /* 454 */ $blk = 4; /* allowing case fallthrough */
  456. /* 455 */ case 4:
  457. /* 456 */ /* --- function return or resume suspension --- */
  458. /* 457 */ if ($ret && $ret.$isSuspension) {
  459. /* 458 */ return $saveSuspension($ret, './my_test.py', 7, 6);
  460. /* 459 */ }
  461. /* 460 */ var $lattr138 = $ret;
  462. /* 461 */ $ret;
  463. /* 462 */ $ret = Sk.misceval.callsimOrSuspend($loadname136, $lattr138);
  464. /* 463 */ $blk = 5; /* allowing case fallthrough */
  465. /* 464 */ case 5:
  466. /* 465 */ /* --- function return or resume suspension --- */
  467. /* 466 */ if ($ret && $ret.$isSuspension) {
  468. /* 467 */ return $saveSuspension($ret, './my_test.py', 7, 0);
  469. /* 468 */ }
  470. /* 469 */ var $call139 = $ret;
  471. /* 470 */ //
  472. /* 471 */ // line 7:
  473. /* 472 */ // print(t.x)
  474. /* 473 */ // ^
  475. /* 474 */ //
  476. /* 475 */ Sk.currLineNo = 7;
  477. /* 476 */ Sk.currColNo = 0;
  478. /* 477 */
  479. /* 478 */
  480. /* 479 */ Sk.currFilename = './my_test.py';
  481. /* 480 */
  482. /* 481 */ currLineNo = 7;
  483. /* 482 */ currColNo = 0;
  484. /* 483 */
  485. /* 484 */ return $loc;
  486. /* 485 */ throw new Sk.builtin.SystemError('internal error: unterminated block');
  487. /* 486 */ }
  488. /* 487 */ } catch (err) {
  489. /* 488 */ if (!(err instanceof Sk.builtin.BaseException)) {
  490. /* 489 */ err = new Sk.builtin.ExternalError(err);
  491. /* 490 */ }
  492. /* 491 */ err.traceback.push({
  493. /* 492 */ lineno: $currLineNo,
  494. /* 493 */ colno: $currColNo,
  495. /* 494 */ filename: './my_test.py'
  496. /* 495 */ });
  497. /* 496 */ if ($exc.length > 0) {
  498. /* 497 */ $err = err;
  499. /* 498 */ $blk = $exc.pop();
  500. /* 499 */ continue;
  501. /* 500 */ } else {
  502. /* 501 */ throw err;
  503. /* 502 */ }
  504. /* 503 */ }
  505. /* 504 */ }
  506. /* 505 */ });
  507. /* 506 */ var $scope121 = (function $TestClass$class_outer($globals, $locals, $rest) {
  508. /* 507 */ var $gbl = $globals,
  509. /* 508 */ $loc = $locals;
  510. /* 509 */ (function $TestClass$_closure() {
  511. /* 510 */ var $blk = 0,
  512. /* 511 */ $exc = [],
  513. /* 512 */ $ret = undefined,
  514. /* 513 */ $currLineNo = undefined,
  515. /* 514 */ $currColNo = undefined;
  516. /* 515 */ if (typeof Sk.execStart === 'undefined') {
  517. /* 516 */ Sk.execStart = Date.now()
  518. /* 517 */ }
  519. /* 518 */ while (true) {
  520. /* 519 */ try {
  521. /* 520 */ var $dateNow = Date.now();
  522. /* 521 */ if ($dateNow - Sk.execStart > Sk.execLimit) {
  523. /* 522 */ throw new Sk.builtin.TimeLimitError(Sk.timeoutMsg())
  524. /* 523 */ }
  525. /* 524 */ switch ($blk) {
  526. /* 525 */ case 0:
  527. /* 526 */ /* --- class entry --- */
  528. /* 527 */ //
  529. /* 528 */ // line 2:
  530. /* 529 */ // def __getattr__(self, key):
  531. /* 530 */ // ^
  532. /* 531 */ //
  533. /* 532 */ Sk.currLineNo = 2;
  534. /* 533 */ Sk.currColNo = 4;
  535. /* 534 */
  536. /* 535 */
  537. /* 536 */ Sk.currFilename = './my_test.py';
  538. /* 537 */
  539. /* 538 */
  540. /* 539 */ if (typeof Sk.afterSingleExecution == 'function') {
  541. /* 540 */ Sk.afterSingleExecution($gbl, Sk.currLineNo, Sk.currColNo, Sk.currFilename, 'FunctionDef', {
  542. /* 541 */ "name": {
  543. /* 542 */ "v": "__getattr__"
  544. /* 543 */ },
  545. /* 544 */ "args": {
  546. /* 545 */ "args": [{
  547. /* 546 */ "id": {
  548. /* 547 */ "v": "self"
  549. /* 548 */ },
  550. /* 549 */ "lineno": 2,
  551. /* 550 */ "col_offset": 20,
  552. /* 551 */ "endlineno": 2,
  553. /* 552 */ "col_endoffset": 24},
  554. /* 553 */ {
  555. /* 554 */ "id": {
  556. /* 555 */ "v": "key"
  557. /* 556 */ },
  558. /* 557 */ "lineno": 2,
  559. /* 558 */ "col_offset": 26,
  560. /* 559 */ "endlineno": 2,
  561. /* 560 */ "col_endoffset": 24}],
  562. /* 561 */ "vararg": null,
  563. /* 562 */ "kwarg": null,
  564. /* 563 */ "defaults": []
  565. /* 564 */ },
  566. /* 565 */ "body": [{
  567. /* 566 */ "test": {
  568. /* 567 */ "left": {
  569. /* 568 */ "id": {
  570. /* 569 */ "v": "key"
  571. /* 570 */ },
  572. /* 571 */ "lineno": 3,
  573. /* 572 */ "col_offset": 11,
  574. /* 573 */ "endlineno": 3,
  575. /* 574 */ "col_endoffset": 14
  576. /* 575 */ },
  577. /* 576 */ "ops": [null],
  578. /* 577 */ "comparators": [{
  579. /* 578 */ "s": {
  580. /* 579 */ "v": "t"
  581. /* 580 */ },
  582. /* 581 */ "lineno": 3,
  583. /* 582 */ "col_offset": 18,
  584. /* 583 */ "endlineno": 3,
  585. /* 584 */ "col_endoffset": 21}],
  586. /* 585 */ "lineno": 3,
  587. /* 586 */ "col_offset": 11,
  588. /* 587 */ "endlineno": 3,
  589. /* 588 */ "col_endoffset": 14
  590. /* 589 */ },
  591. /* 590 */ "body": [{
  592. /* 591 */ "value": {
  593. /* 592 */ "n": {
  594. /* 593 */ "v": 5
  595. /* 594 */ },
  596. /* 595 */ "lineno": 4,
  597. /* 596 */ "col_offset": 19,
  598. /* 597 */ "endlineno": 4,
  599. /* 598 */ "col_endoffset": 20
  600. /* 599 */ },
  601. /* 600 */ "lineno": 4,
  602. /* 601 */ "col_offset": 12,
  603. /* 602 */ "endlineno": 4,
  604. /* 603 */ "col_endoffset": 18}],
  605. /* 604 */ "orelse": [],
  606. /* 605 */ "lineno": 3,
  607. /* 606 */ "col_offset": 8,
  608. /* 607 */ "endlineno": 3,
  609. /* 608 */ "col_endoffset": 10}],
  610. /* 609 */ "decorator_list": [],
  611. /* 610 */ "lineno": 2,
  612. /* 611 */ "col_offset": 4,
  613. /* 612 */ "endlineno": 2,
  614. /* 613 */ "col_endoffset": 7,
  615. /* 614 */ "scopeId": 20
  616. /* 615 */ });
  617. /* 616 */ }
  618. /* 617 */ currLineNo = 2;
  619. /* 618 */ currColNo = 4;
  620. /* 619 */
  621. /* 620 */ $scope122.co_name = new Sk.builtins['str']('__getattr__');
  622. /* 621 */ $scope122.co_varnames = ['self', 'key'];
  623. /* 622 */ var $funcobj128 = new Sk.builtins['function']($scope122, $gbl);
  624. /* 623 */ $loc.__getattr__ = $funcobj128;
  625. /* 624 */ return;
  626. /* 625 */ throw new Sk.builtin.SystemError('internal error: unterminated block');
  627. /* 626 */ }
  628. /* 627 */ } catch (err) {
  629. /* 628 */ if (!(err instanceof Sk.builtin.BaseException)) {
  630. /* 629 */ err = new Sk.builtin.ExternalError(err);
  631. /* 630 */ }
  632. /* 631 */ err.traceback.push({
  633. /* 632 */ lineno: $currLineNo,
  634. /* 633 */ colno: $currColNo,
  635. /* 634 */ filename: './my_test.py'
  636. /* 635 */ });
  637. /* 636 */ if ($exc.length > 0) {
  638. /* 637 */ $err = err;
  639. /* 638 */ $blk = $exc.pop();
  640. /* 639 */ continue;
  641. /* 640 */ } else {
  642. /* 641 */ throw err;
  643. /* 642 */ }
  644. /* 643 */ }
  645. /* 644 */ }
  646. /* 645 */ }).apply(null, $rest);
  647. /* 646 */ });
  648. /* 647 */ var $scope122 = (function $__getattr__123$(self, key) {
  649. /* 648 */ var key, key, self, $compareres124, $str125;
  650. /* 649 */ var $wakeFromSuspension = function() {
  651. /* 650 */ var susp = $scope122.$wakingSuspension;
  652. /* 651 */ delete $scope122.$wakingSuspension;
  653. /* 652 */ $blk = susp.$blk;
  654. /* 653 */ $loc = susp.$loc;
  655. /* 654 */ $gbl = susp.$gbl;
  656. /* 655 */ $exc = susp.$exc;
  657. /* 656 */ $err = susp.$err;
  658. /* 657 */ $currLineNo = susp.$lineno;
  659. /* 658 */ $currColNo = susp.$colno;
  660. /* 659 */ Sk.lastYield = Date.now();
  661. /* 660 */ key = susp.$tmps.key;
  662. /* 661 */ self = susp.$tmps.self;
  663. /* 662 */ $compareres124 = susp.$tmps.$compareres124;
  664. /* 663 */ $str125 = susp.$tmps.$str125;
  665. /* 664 */ try {
  666. /* 665 */ $ret = susp.child.resume();
  667. /* 666 */ } catch (err) {
  668. /* 667 */ if (!(err instanceof Sk.builtin.BaseException)) {
  669. /* 668 */ err = new Sk.builtin.ExternalError(err);
  670. /* 669 */ }
  671. /* 670 */ err.traceback.push({
  672. /* 671 */ lineno: $currLineNo,
  673. /* 672 */ colno: $currColNo,
  674. /* 673 */ filename: './my_test.py'
  675. /* 674 */ });
  676. /* 675 */ if ($exc.length > 0) {
  677. /* 676 */ $err = err;
  678. /* 677 */ $blk = $exc.pop();
  679. /* 678 */ } else {
  680. /* 679 */ throw err;
  681. /* 680 */ }
  682. /* 681 */ }
  683. /* 682 */ };
  684. /* 683 */ var $saveSuspension = function($child, $filename, $lineno, $colno) {
  685. /* 684 */ var susp = new Sk.misceval.Suspension();
  686. /* 685 */ susp.child = $child;
  687. /* 686 */ susp.resume = function() {
  688. /* 687 */ $scope122.$wakingSuspension = susp;
  689. /* 688 */ return $scope122();
  690. /* 689 */ };
  691. /* 690 */ susp.data = susp.child.data;
  692. /* 691 */ susp.$blk = $blk;
  693. /* 692 */ susp.$loc = $loc;
  694. /* 693 */ susp.$gbl = $gbl;
  695. /* 694 */ susp.$exc = $exc;
  696. /* 695 */ susp.$err = $err;
  697. /* 696 */ susp.$filename = $filename;
  698. /* 697 */ susp.$lineno = $lineno;
  699. /* 698 */ susp.$colno = $colno;
  700. /* 699 */ susp.optional = susp.child.optional;
  701. /* 700 */ susp.$tmps = {
  702. /* 701 */ "key": key,
  703. /* 702 */ "self": self,
  704. /* 703 */ "$compareres124": $compareres124,
  705. /* 704 */ "$str125": $str125
  706. /* 705 */ };
  707. /* 706 */ return susp;
  708. /* 707 */ };
  709. /* 708 */ var $blk = 0,
  710. /* 709 */ $exc = [],
  711. /* 710 */ $loc = {},
  712. /* 711 */ $gbl = this,
  713. /* 712 */ $err = undefined,
  714. /* 713 */ $ret = undefined,
  715. /* 714 */ $currLineNo = undefined,
  716. /* 715 */ $currColNo = undefined;
  717. /* 716 */ if (typeof Sk.execStart === 'undefined') {
  718. /* 717 */ Sk.execStart = Date.now()
  719. /* 718 */ }
  720. /* 719 */ if (typeof Sk.lastYield === 'undefined') {
  721. /* 720 */ Sk.lastYield = Date.now()
  722. /* 721 */ }
  723. /* 722 */ if ($scope122.$wakingSuspension !== undefined) {
  724. /* 723 */ $wakeFromSuspension();
  725. /* 724 */ } else {
  726. /* 725 */ Sk.builtin.pyCheckArgs("__getattr__", arguments, 2, 2, false, false);
  727. /* 726 */ }
  728. /* 727 */ while (true) {
  729. /* 728 */ try {
  730. /* 729 */ var $dateNow = Date.now();
  731. /* 730 */ if ($dateNow - Sk.execStart > Sk.execLimit) {
  732. /* 731 */ throw new Sk.builtin.TimeLimitError(Sk.timeoutMsg())
  733. /* 732 */ }
  734. /* 733 */ if ($dateNow - Sk.lastYield > Sk.yieldLimit) {
  735. /* 734 */ var $susp = $saveSuspension({
  736. /* 735 */ data: {
  737. /* 736 */ type: 'Sk.yield'
  738. /* 737 */ },
  739. /* 738 */ resume: function() {}
  740. /* 739 */ }, './my_test.py', $currLineNo, $currColNo);
  741. /* 740 */ $susp.$blk = $blk;
  742. /* 741 */ $susp.optional = true;
  743. /* 742 */ return $susp;
  744. /* 743 */ }
  745. /* 744 */ switch ($blk) {
  746. /* 745 */ case 0:
  747. /* 746 */ /* --- codeobj entry --- */
  748. /* 747 */ if (self === undefined) {
  749. /* 748 */ throw new Sk.builtin.UnboundLocalError('local variable \'self\' referenced before assignment');
  750. /* 749 */ }
  751. /* 750 */ if (key === undefined) {
  752. /* 751 */ throw new Sk.builtin.UnboundLocalError('local variable \'key\' referenced before assignment');
  753. /* 752 */ }
  754. /* 753 */
  755. /* 754 */ //
  756. /* 755 */ // line 3:
  757. /* 756 */ // if key == 't':
  758. /* 757 */ // ^
  759. /* 758 */ //
  760. /* 759 */ Sk.currLineNo = 3;
  761. /* 760 */ Sk.currColNo = 8;
  762. /* 761 */
  763. /* 762 */
  764. /* 763 */ Sk.currFilename = './my_test.py';
  765. /* 764 */
  766. /* 765 */
  767. /* 766 */ if (typeof Sk.afterSingleExecution == 'function') {
  768. /* 767 */ Sk.afterSingleExecution($gbl, Sk.currLineNo, Sk.currColNo, Sk.currFilename, 'If_', {
  769. /* 768 */ "test": {
  770. /* 769 */ "left": {
  771. /* 770 */ "id": {
  772. /* 771 */ "v": "key"
  773. /* 772 */ },
  774. /* 773 */ "lineno": 3,
  775. /* 774 */ "col_offset": 11,
  776. /* 775 */ "endlineno": 3,
  777. /* 776 */ "col_endoffset": 14
  778. /* 777 */ },
  779. /* 778 */ "ops": [null],
  780. /* 779 */ "comparators": [{
  781. /* 780 */ "s": {
  782. /* 781 */ "v": "t"
  783. /* 782 */ },
  784. /* 783 */ "lineno": 3,
  785. /* 784 */ "col_offset": 18,
  786. /* 785 */ "endlineno": 3,
  787. /* 786 */ "col_endoffset": 21}],
  788. /* 787 */ "lineno": 3,
  789. /* 788 */ "col_offset": 11,
  790. /* 789 */ "endlineno": 3,
  791. /* 790 */ "col_endoffset": 14
  792. /* 791 */ },
  793. /* 792 */ "body": [{
  794. /* 793 */ "value": {
  795. /* 794 */ "n": {
  796. /* 795 */ "v": 5
  797. /* 796 */ },
  798. /* 797 */ "lineno": 4,
  799. /* 798 */ "col_offset": 19,
  800. /* 799 */ "endlineno": 4,
  801. /* 800 */ "col_endoffset": 20
  802. /* 801 */ },
  803. /* 802 */ "lineno": 4,
  804. /* 803 */ "col_offset": 12,
  805. /* 804 */ "endlineno": 4,
  806. /* 805 */ "col_endoffset": 18}],
  807. /* 806 */ "orelse": [],
  808. /* 807 */ "lineno": 3,
  809. /* 808 */ "col_offset": 8,
  810. /* 809 */ "endlineno": 3,
  811. /* 810 */ "col_endoffset": 10
  812. /* 811 */ });
  813. /* 812 */ }
  814. /* 813 */ currLineNo = 3;
  815. /* 814 */ currColNo = 8;
  816. /* 815 */
  817. /* 816 */ if (key === undefined) {
  818. /* 817 */ throw new Sk.builtin.UnboundLocalError('local variable \'key\' referenced before assignment');
  819. /* 818 */ }
  820. /* 819 */ var $compareres124 = null;
  821. /* 820 */ var $str125 = new Sk.builtins['str']('t');
  822. /* 821 */ $ret = Sk.builtin.bool(Sk.misceval.richCompareBool(key, $str125, 'Eq', true));
  823. /* 822 */ $blk = 3; /* allowing case fallthrough */
  824. /* 823 */ case 3:
  825. /* 824 */ /* --- function return or resume suspension --- */
  826. /* 825 */ if ($ret && $ret.$isSuspension) {
  827. /* 826 */ return $saveSuspension($ret, './my_test.py', 3, 11);
  828. /* 827 */ }
  829. /* 828 */ $compareres124 = $ret;
  830. /* 829 */ var $jfalse126 = ($ret === false || !Sk.misceval.isTrue($ret));
  831. /* 830 */ if ($jfalse126) { /*test failed */
  832. /* 831 */ $blk = 2;
  833. /* 832 */ continue;
  834. /* 833 */ }
  835. /* 834 */ $blk = 2; /* allowing case fallthrough */
  836. /* 835 */ case 2:
  837. /* 836 */ /* --- done --- */
  838. /* 837 */ var $jfalse127 = ($compareres124 === false || !Sk.misceval.isTrue($compareres124));
  839. /* 838 */ if ($jfalse127) { /*test failed */
  840. /* 839 */ $blk = 1;
  841. /* 840 */ continue;
  842. /* 841 */ }
  843. /* 842 */ //
  844. /* 843 */ // line 4:
  845. /* 844 */ // return 5
  846. /* 845 */ // ^
  847. /* 846 */ //
  848. /* 847 */ Sk.currLineNo = 4;
  849. /* 848 */ Sk.currColNo = 12;
  850. /* 849 */
  851. /* 850 */
  852. /* 851 */ Sk.currFilename = './my_test.py';
  853. /* 852 */
  854. /* 853 */
  855. /* 854 */ if (typeof Sk.afterSingleExecution == 'function') {
  856. /* 855 */ Sk.afterSingleExecution($gbl, Sk.currLineNo, Sk.currColNo, Sk.currFilename, 'Return_', {
  857. /* 856 */ "value": {
  858. /* 857 */ "n": {
  859. /* 858 */ "v": 5
  860. /* 859 */ },
  861. /* 860 */ "lineno": 4,
  862. /* 861 */ "col_offset": 19,
  863. /* 862 */ "endlineno": 4,
  864. /* 863 */ "col_endoffset": 20
  865. /* 864 */ },
  866. /* 865 */ "lineno": 4,
  867. /* 866 */ "col_offset": 12,
  868. /* 867 */ "endlineno": 4,
  869. /* 868 */ "col_endoffset": 18
  870. /* 869 */ });
  871. /* 870 */ }
  872. /* 871 */ currLineNo = 4;
  873. /* 872 */ currColNo = 12;
  874. /* 873 */
  875. /* 874 */ return new Sk.builtin.int_(5);
  876. /* 875 */ $blk = 1; /* allowing case fallthrough */
  877. /* 876 */ case 1:
  878. /* 877 */ /* --- end of if --- */
  879. /* 878 */ return Sk.builtin.none.none$;
  880. /* 879 */ throw new Sk.builtin.SystemError('internal error: unterminated block');
  881. /* 880 */ }
  882. /* 881 */ } catch (err) {
  883. /* 882 */ if (!(err instanceof Sk.builtin.BaseException)) {
  884. /* 883 */ err = new Sk.builtin.ExternalError(err);
  885. /* 884 */ }
  886. /* 885 */ err.traceback.push({
  887. /* 886 */ lineno: $currLineNo,
  888. /* 887 */ colno: $currColNo,
  889. /* 888 */ filename: './my_test.py'
  890. /* 889 */ });
  891. /* 890 */ if ($exc.length > 0) {
  892. /* 891 */ $err = err;
  893. /* 892 */ $blk = $exc.pop();
  894. /* 893 */ continue;
  895. /* 894 */ } else {
  896. /* 895 */ throw err;
  897. /* 896 */ }
  898. /* 897 */ }
  899. /* 898 */ }
  900. /* 899 */ });
  901. /* 900 */ return $scope120;
  902. /* 901 */ }();
  903. 5
  904. None