UNPKG

elm-basic-compile

Version:

elm-compiler built with GHCJS and wrapped in a simple interface

2,050 lines (1,953 loc) 11.4 MB
(function(process) { var process = process; if (process && process.browser) { process = undefined; } var h$currentThread = null; var h$stack = null; var h$sp = 0; var h$initStatic = []; var h$staticThunks = {}; var h$staticThunksArr = []; var h$regs = []; var h$r1 = 0; var h$r2 = 0; var h$r3 = 0; var h$r4 = 0; var h$r5 = 0; var h$r6 = 0; var h$r7 = 0; var h$r8 = 0; var h$r9 = 0; var h$r10 = 0; var h$r11 = 0; var h$r12 = 0; var h$r13 = 0; var h$r14 = 0; var h$r15 = 0; var h$r16 = 0; var h$r17 = 0; var h$r18 = 0; var h$r19 = 0; var h$r20 = 0; var h$r21 = 0; var h$r22 = 0; var h$r23 = 0; var h$r24 = 0; var h$r25 = 0; var h$r26 = 0; var h$r27 = 0; var h$r28 = 0; var h$r29 = 0; var h$r30 = 0; var h$r31 = 0; var h$r32 = 0; function h$getReg(h$RTSD_0) { switch (h$RTSD_0) { case (1): return h$r1; case (2): return h$r2; case (3): return h$r3; case (4): return h$r4; case (5): return h$r5; case (6): return h$r6; case (7): return h$r7; case (8): return h$r8; case (9): return h$r9; case (10): return h$r10; case (11): return h$r11; case (12): return h$r12; case (13): return h$r13; case (14): return h$r14; case (15): return h$r15; case (16): return h$r16; case (17): return h$r17; case (18): return h$r18; case (19): return h$r19; case (20): return h$r20; case (21): return h$r21; case (22): return h$r22; case (23): return h$r23; case (24): return h$r24; case (25): return h$r25; case (26): return h$r26; case (27): return h$r27; case (28): return h$r28; case (29): return h$r29; case (30): return h$r30; case (31): return h$r31; case (32): return h$r32; case (33): return h$regs[0]; case (34): return h$regs[1]; case (35): return h$regs[2]; case (36): return h$regs[3]; case (37): return h$regs[4]; case (38): return h$regs[5]; case (39): return h$regs[6]; case (40): return h$regs[7]; case (41): return h$regs[8]; case (42): return h$regs[9]; case (43): return h$regs[10]; case (44): return h$regs[11]; case (45): return h$regs[12]; case (46): return h$regs[13]; case (47): return h$regs[14]; case (48): return h$regs[15]; case (49): return h$regs[16]; case (50): return h$regs[17]; case (51): return h$regs[18]; case (52): return h$regs[19]; case (53): return h$regs[20]; case (54): return h$regs[21]; case (55): return h$regs[22]; case (56): return h$regs[23]; case (57): return h$regs[24]; case (58): return h$regs[25]; case (59): return h$regs[26]; case (60): return h$regs[27]; case (61): return h$regs[28]; case (62): return h$regs[29]; case (63): return h$regs[30]; case (64): return h$regs[31]; case (65): return h$regs[32]; case (66): return h$regs[33]; case (67): return h$regs[34]; case (68): return h$regs[35]; case (69): return h$regs[36]; case (70): return h$regs[37]; case (71): return h$regs[38]; case (72): return h$regs[39]; case (73): return h$regs[40]; case (74): return h$regs[41]; case (75): return h$regs[42]; case (76): return h$regs[43]; case (77): return h$regs[44]; case (78): return h$regs[45]; case (79): return h$regs[46]; case (80): return h$regs[47]; case (81): return h$regs[48]; case (82): return h$regs[49]; case (83): return h$regs[50]; case (84): return h$regs[51]; case (85): return h$regs[52]; case (86): return h$regs[53]; case (87): return h$regs[54]; case (88): return h$regs[55]; case (89): return h$regs[56]; case (90): return h$regs[57]; case (91): return h$regs[58]; case (92): return h$regs[59]; case (93): return h$regs[60]; case (94): return h$regs[61]; case (95): return h$regs[62]; case (96): return h$regs[63]; case (97): return h$regs[64]; case (98): return h$regs[65]; case (99): return h$regs[66]; case (100): return h$regs[67]; case (101): return h$regs[68]; case (102): return h$regs[69]; case (103): return h$regs[70]; case (104): return h$regs[71]; case (105): return h$regs[72]; case (106): return h$regs[73]; case (107): return h$regs[74]; case (108): return h$regs[75]; case (109): return h$regs[76]; case (110): return h$regs[77]; case (111): return h$regs[78]; case (112): return h$regs[79]; case (113): return h$regs[80]; case (114): return h$regs[81]; case (115): return h$regs[82]; case (116): return h$regs[83]; case (117): return h$regs[84]; case (118): return h$regs[85]; case (119): return h$regs[86]; case (120): return h$regs[87]; case (121): return h$regs[88]; case (122): return h$regs[89]; case (123): return h$regs[90]; case (124): return h$regs[91]; case (125): return h$regs[92]; case (126): return h$regs[93]; case (127): return h$regs[94]; case (128): return h$regs[95]; default: }; }; function h$setReg(h$RTSD_1, h$RTSD_2) { switch (h$RTSD_1) { case (1): h$r1 = h$RTSD_2; return undefined; case (2): h$r2 = h$RTSD_2; return undefined; case (3): h$r3 = h$RTSD_2; return undefined; case (4): h$r4 = h$RTSD_2; return undefined; case (5): h$r5 = h$RTSD_2; return undefined; case (6): h$r6 = h$RTSD_2; return undefined; case (7): h$r7 = h$RTSD_2; return undefined; case (8): h$r8 = h$RTSD_2; return undefined; case (9): h$r9 = h$RTSD_2; return undefined; case (10): h$r10 = h$RTSD_2; return undefined; case (11): h$r11 = h$RTSD_2; return undefined; case (12): h$r12 = h$RTSD_2; return undefined; case (13): h$r13 = h$RTSD_2; return undefined; case (14): h$r14 = h$RTSD_2; return undefined; case (15): h$r15 = h$RTSD_2; return undefined; case (16): h$r16 = h$RTSD_2; return undefined; case (17): h$r17 = h$RTSD_2; return undefined; case (18): h$r18 = h$RTSD_2; return undefined; case (19): h$r19 = h$RTSD_2; return undefined; case (20): h$r20 = h$RTSD_2; return undefined; case (21): h$r21 = h$RTSD_2; return undefined; case (22): h$r22 = h$RTSD_2; return undefined; case (23): h$r23 = h$RTSD_2; return undefined; case (24): h$r24 = h$RTSD_2; return undefined; case (25): h$r25 = h$RTSD_2; return undefined; case (26): h$r26 = h$RTSD_2; return undefined; case (27): h$r27 = h$RTSD_2; return undefined; case (28): h$r28 = h$RTSD_2; return undefined; case (29): h$r29 = h$RTSD_2; return undefined; case (30): h$r30 = h$RTSD_2; return undefined; case (31): h$r31 = h$RTSD_2; return undefined; case (32): h$r32 = h$RTSD_2; return undefined; case (33): h$regs[0] = h$RTSD_2; return undefined; case (34): h$regs[1] = h$RTSD_2; return undefined; case (35): h$regs[2] = h$RTSD_2; return undefined; case (36): h$regs[3] = h$RTSD_2; return undefined; case (37): h$regs[4] = h$RTSD_2; return undefined; case (38): h$regs[5] = h$RTSD_2; return undefined; case (39): h$regs[6] = h$RTSD_2; return undefined; case (40): h$regs[7] = h$RTSD_2; return undefined; case (41): h$regs[8] = h$RTSD_2; return undefined; case (42): h$regs[9] = h$RTSD_2; return undefined; case (43): h$regs[10] = h$RTSD_2; return undefined; case (44): h$regs[11] = h$RTSD_2; return undefined; case (45): h$regs[12] = h$RTSD_2; return undefined; case (46): h$regs[13] = h$RTSD_2; return undefined; case (47): h$regs[14] = h$RTSD_2; return undefined; case (48): h$regs[15] = h$RTSD_2; return undefined; case (49): h$regs[16] = h$RTSD_2; return undefined; case (50): h$regs[17] = h$RTSD_2; return undefined; case (51): h$regs[18] = h$RTSD_2; return undefined; case (52): h$regs[19] = h$RTSD_2; return undefined; case (53): h$regs[20] = h$RTSD_2; return undefined; case (54): h$regs[21] = h$RTSD_2; return undefined; case (55): h$regs[22] = h$RTSD_2; return undefined; case (56): h$regs[23] = h$RTSD_2; return undefined; case (57): h$regs[24] = h$RTSD_2; return undefined; case (58): h$regs[25] = h$RTSD_2; return undefined; case (59): h$regs[26] = h$RTSD_2; return undefined; case (60): h$regs[27] = h$RTSD_2; return undefined; case (61): h$regs[28] = h$RTSD_2; return undefined; case (62): h$regs[29] = h$RTSD_2; return undefined; case (63): h$regs[30] = h$RTSD_2; return undefined; case (64): h$regs[31] = h$RTSD_2; return undefined; case (65): h$regs[32] = h$RTSD_2; return undefined; case (66): h$regs[33] = h$RTSD_2; return undefined; case (67): h$regs[34] = h$RTSD_2; return undefined; case (68): h$regs[35] = h$RTSD_2; return undefined; case (69): h$regs[36] = h$RTSD_2; return undefined; case (70): h$regs[37] = h$RTSD_2; return undefined; case (71): h$regs[38] = h$RTSD_2; return undefined; case (72): h$regs[39] = h$RTSD_2; return undefined; case (73): h$regs[40] = h$RTSD_2; return undefined; case (74): h$regs[41] = h$RTSD_2; return undefined; case (75): h$regs[42] = h$RTSD_2; return undefined; case (76): h$regs[43] = h$RTSD_2; return undefined; case (77): h$regs[44] = h$RTSD_2; return undefined; case (78): h$regs[45] = h$RTSD_2; return undefined; case (79): h$regs[46] = h$RTSD_2; return undefined; case (80): h$regs[47] = h$RTSD_2; return undefined; case (81): h$regs[48] = h$RTSD_2; return undefined; case (82): h$regs[49] = h$RTSD_2; return undefined; case (83): h$regs[50] = h$RTSD_2; return undefined; case (84): h$regs[51] = h$RTSD_2; return undefined; case (85): h$regs[52] = h$RTSD_2; return undefined; case (86): h$regs[53] = h$RTSD_2; return undefined; case (87): h$regs[54] = h$RTSD_2; return undefined; case (88): h$regs[55] = h$RTSD_2; return undefined; case (89): h$regs[56] = h$RTSD_2; return undefined; case (90): h$regs[57] = h$RTSD_2; return undefined; case (91): h$regs[58] = h$RTSD_2; return undefined; case (92): h$regs[59] = h$RTSD_2; return undefined; case (93): h$regs[60] = h$RTSD_2; return undefined; case (94): h$regs[61] = h$RTSD_2; return undefined; case (95): h$regs[62] = h$RTSD_2; return undefined; case (96): h$regs[63] = h$RTSD_2; return undefined; case (97): h$regs[64] = h$RTSD_2; return undefined; case (98): h$regs[65] = h$RTSD_2; return undefined; case (99): h$regs[66] = h$RTSD_2; return undefined; case (100): h$regs[67] = h$RTSD_2; return undefined; case (101): h$regs[68] = h$RTSD_2; return undefined; case (102): h$regs[69] = h$RTSD_2; return undefined; case (103): h$regs[70] = h$RTSD_2; return undefined; case (104): h$regs[71] = h$RTSD_2; return undefined; case (105): h$regs[72] = h$RTSD_2; return undefined; case (106): h$regs[73] = h$RTSD_2; return undefined; case (107): h$regs[74] = h$RTSD_2; return undefined; case (108): h$regs[75] = h$RTSD_2; return undefined; case (109): h$regs[76] = h$RTSD_2; return undefined; case (110): h$regs[77] = h$RTSD_2; return undefined; case (111): h$regs[78] = h$RTSD_2; return undefined; case (112): h$regs[79] = h$RTSD_2; return undefined; case (113): h$regs[80] = h$RTSD_2; return undefined; case (114): h$regs[81] = h$RTSD_2; return undefined; case (115): h$regs[82] = h$RTSD_2; return undefined; case (116): h$regs[83] = h$RTSD_2; return undefined; case (117): h$regs[84] = h$RTSD_2; return undefined; case (118): h$regs[85] = h$RTSD_2; return undefined; case (119): h$regs[86] = h$RTSD_2; return undefined; case (120): h$regs[87] = h$RTSD_2; return undefined; case (121): h$regs[88] = h$RTSD_2; return undefined; case (122): h$regs[89] = h$RTSD_2; return undefined; case (123): h$regs[90] = h$RTSD_2; return undefined; case (124): h$regs[91] = h$RTSD_2; return undefined; case (125): h$regs[92] = h$RTSD_2; return undefined; case (126): h$regs[93] = h$RTSD_2; return undefined; case (127): h$regs[94] = h$RTSD_2; return undefined; case (128): h$regs[95] = h$RTSD_2; return undefined; default: }; }; function h$l1(x1) { h$r1 = x1; }; function h$l2(x1, x2) { h$r2 = x1; h$r1 = x2; }; function h$l3(x1, x2, x3) { h$r3 = x1; h$r2 = x2; h$r1 = x3; }; function h$l4(x1, x2, x3, x4) { h$r4 = x1; h$r3 = x2; h$r2 = x3; h$r1 = x4; }; function h$l5(x1, x2, x3, x4, x5) { h$r5 = x1; h$r4 = x2; h$r3 = x3; h$r2 = x4; h$r1 = x5; }; function h$l6(x1, x2, x3, x4, x5, x6) { h$r6 = x1; h$r5 = x2; h$r4 = x3; h$r3 = x4; h$r2 = x5; h$r1 = x6; }; function h$l7(x1, x2, x3, x4, x5, x6, x7) { h$r7 = x1; h$r6 = x2; h$r5 = x3; h$r4 = x4; h$r3 = x5; h$r2 = x6; h$r1 = x7; }; function h$l8(x1, x2, x3, x4, x5, x6, x7, x8) { h$r8 = x1; h$r7 = x2; h$r6 = x3; h$r5 = x4; h$r4 = x5; h$r3 = x6; h$r2 = x7; h$r1 = x8; }; function h$l9(x1, x2, x3, x4, x5, x6, x7, x8, x9) { h$r9 = x1; h$r8 = x2; h$r7 = x3; h$r6 = x4; h$r5 = x5; h$r4 = x6; h$r3 = x7; h$r2 = x8; h$r1 = x9; }; function h$l10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) { h$r10 = x1; h$r9 = x2; h$r8 = x3; h$r7 = x4; h$r6 = x5; h$r5 = x6; h$r4 = x7; h$r3 = x8; h$r2 = x9; h$r1 = x10; }; function h$l11(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) { h$r11 = x1; h$r10 = x2; h$r9 = x3; h$r8 = x4; h$r7 = x5; h$r6 = x6; h$r5 = x7; h$r4 = x8; h$r3 = x9; h$r2 = x10; h$r1 = x11; }; function h$l12(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) { h$r12 = x1; h$r11 = x2; h$r10 = x3; h$r9 = x4; h$r8 = x5; h$r7 = x6; h$r6 = x7; h$r5 = x8; h$r4 = x9; h$r3 = x10; h$r2 = x11; h$r1 = x12; }; function h$l13(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) { h$r13 = x1; h$r12 = x2; h$r11 = x3; h$r10 = x4; h$r9 = x5; h$r8 = x6; h$r7 = x7; h$r6 = x8; h$r5 = x9; h$r4 = x10; h$r3 = x11; h$r2 = x12; h$r1 = x13; }; function h$l14(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) { h$r14 = x1; h$r13 = x2; h$r12 = x3; h$r11 = x4; h$r10 = x5; h$r9 = x6; h$r8 = x7; h$r7 = x8; h$r6 = x9; h$r5 = x10; h$r4 = x11; h$r3 = x12; h$r2 = x13; h$r1 = x14; }; function h$l15(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) { h$r15 = x1; h$r14 = x2; h$r13 = x3; h$r12 = x4; h$r11 = x5; h$r10 = x6; h$r9 = x7; h$r8 = x8; h$r7 = x9; h$r6 = x10; h$r5 = x11; h$r4 = x12; h$r3 = x13; h$r2 = x14; h$r1 = x15; }; function h$l16(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) { h$r16 = x1; h$r15 = x2; h$r14 = x3; h$r13 = x4; h$r12 = x5; h$r11 = x6; h$r10 = x7; h$r9 = x8; h$r8 = x9; h$r7 = x10; h$r6 = x11; h$r5 = x12; h$r4 = x13; h$r3 = x14; h$r2 = x15; h$r1 = x16; }; function h$l17(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) { h$r17 = x1; h$r16 = x2; h$r15 = x3; h$r14 = x4; h$r13 = x5; h$r12 = x6; h$r11 = x7; h$r10 = x8; h$r9 = x9; h$r8 = x10; h$r7 = x11; h$r6 = x12; h$r5 = x13; h$r4 = x14; h$r3 = x15; h$r2 = x16; h$r1 = x17; }; function h$l18(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) { h$r18 = x1; h$r17 = x2; h$r16 = x3; h$r15 = x4; h$r14 = x5; h$r13 = x6; h$r12 = x7; h$r11 = x8; h$r10 = x9; h$r9 = x10; h$r8 = x11; h$r7 = x12; h$r6 = x13; h$r5 = x14; h$r4 = x15; h$r3 = x16; h$r2 = x17; h$r1 = x18; }; function h$l19(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) { h$r19 = x1; h$r18 = x2; h$r17 = x3; h$r16 = x4; h$r15 = x5; h$r14 = x6; h$r13 = x7; h$r12 = x8; h$r11 = x9; h$r10 = x10; h$r9 = x11; h$r8 = x12; h$r7 = x13; h$r6 = x14; h$r5 = x15; h$r4 = x16; h$r3 = x17; h$r2 = x18; h$r1 = x19; }; function h$l20(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) { h$r20 = x1; h$r19 = x2; h$r18 = x3; h$r17 = x4; h$r16 = x5; h$r15 = x6; h$r14 = x7; h$r13 = x8; h$r12 = x9; h$r11 = x10; h$r10 = x11; h$r9 = x12; h$r8 = x13; h$r7 = x14; h$r6 = x15; h$r5 = x16; h$r4 = x17; h$r3 = x18; h$r2 = x19; h$r1 = x20; }; function h$l21(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) { h$r21 = x1; h$r20 = x2; h$r19 = x3; h$r18 = x4; h$r17 = x5; h$r16 = x6; h$r15 = x7; h$r14 = x8; h$r13 = x9; h$r12 = x10; h$r11 = x11; h$r10 = x12; h$r9 = x13; h$r8 = x14; h$r7 = x15; h$r6 = x16; h$r5 = x17; h$r4 = x18; h$r3 = x19; h$r2 = x20; h$r1 = x21; }; function h$l22(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) { h$r22 = x1; h$r21 = x2; h$r20 = x3; h$r19 = x4; h$r18 = x5; h$r17 = x6; h$r16 = x7; h$r15 = x8; h$r14 = x9; h$r13 = x10; h$r12 = x11; h$r11 = x12; h$r10 = x13; h$r9 = x14; h$r8 = x15; h$r7 = x16; h$r6 = x17; h$r5 = x18; h$r4 = x19; h$r3 = x20; h$r2 = x21; h$r1 = x22; }; function h$l23(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23) { h$r23 = x1; h$r22 = x2; h$r21 = x3; h$r20 = x4; h$r19 = x5; h$r18 = x6; h$r17 = x7; h$r16 = x8; h$r15 = x9; h$r14 = x10; h$r13 = x11; h$r12 = x12; h$r11 = x13; h$r10 = x14; h$r9 = x15; h$r8 = x16; h$r7 = x17; h$r6 = x18; h$r5 = x19; h$r4 = x20; h$r3 = x21; h$r2 = x22; h$r1 = x23; }; function h$l24(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24) { h$r24 = x1; h$r23 = x2; h$r22 = x3; h$r21 = x4; h$r20 = x5; h$r19 = x6; h$r18 = x7; h$r17 = x8; h$r16 = x9; h$r15 = x10; h$r14 = x11; h$r13 = x12; h$r12 = x13; h$r11 = x14; h$r10 = x15; h$r9 = x16; h$r8 = x17; h$r7 = x18; h$r6 = x19; h$r5 = x20; h$r4 = x21; h$r3 = x22; h$r2 = x23; h$r1 = x24; }; function h$l25(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25) { h$r25 = x1; h$r24 = x2; h$r23 = x3; h$r22 = x4; h$r21 = x5; h$r20 = x6; h$r19 = x7; h$r18 = x8; h$r17 = x9; h$r16 = x10; h$r15 = x11; h$r14 = x12; h$r13 = x13; h$r12 = x14; h$r11 = x15; h$r10 = x16; h$r9 = x17; h$r8 = x18; h$r7 = x19; h$r6 = x20; h$r5 = x21; h$r4 = x22; h$r3 = x23; h$r2 = x24; h$r1 = x25; }; function h$l26(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26) { h$r26 = x1; h$r25 = x2; h$r24 = x3; h$r23 = x4; h$r22 = x5; h$r21 = x6; h$r20 = x7; h$r19 = x8; h$r18 = x9; h$r17 = x10; h$r16 = x11; h$r15 = x12; h$r14 = x13; h$r13 = x14; h$r12 = x15; h$r11 = x16; h$r10 = x17; h$r9 = x18; h$r8 = x19; h$r7 = x20; h$r6 = x21; h$r5 = x22; h$r4 = x23; h$r3 = x24; h$r2 = x25; h$r1 = x26; }; function h$l27(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27) { h$r27 = x1; h$r26 = x2; h$r25 = x3; h$r24 = x4; h$r23 = x5; h$r22 = x6; h$r21 = x7; h$r20 = x8; h$r19 = x9; h$r18 = x10; h$r17 = x11; h$r16 = x12; h$r15 = x13; h$r14 = x14; h$r13 = x15; h$r12 = x16; h$r11 = x17; h$r10 = x18; h$r9 = x19; h$r8 = x20; h$r7 = x21; h$r6 = x22; h$r5 = x23; h$r4 = x24; h$r3 = x25; h$r2 = x26; h$r1 = x27; }; function h$l28(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28) { h$r28 = x1; h$r27 = x2; h$r26 = x3; h$r25 = x4; h$r24 = x5; h$r23 = x6; h$r22 = x7; h$r21 = x8; h$r20 = x9; h$r19 = x10; h$r18 = x11; h$r17 = x12; h$r16 = x13; h$r15 = x14; h$r14 = x15; h$r13 = x16; h$r12 = x17; h$r11 = x18; h$r10 = x19; h$r9 = x20; h$r8 = x21; h$r7 = x22; h$r6 = x23; h$r5 = x24; h$r4 = x25; h$r3 = x26; h$r2 = x27; h$r1 = x28; }; function h$l29(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29) { h$r29 = x1; h$r28 = x2; h$r27 = x3; h$r26 = x4; h$r25 = x5; h$r24 = x6; h$r23 = x7; h$r22 = x8; h$r21 = x9; h$r20 = x10; h$r19 = x11; h$r18 = x12; h$r17 = x13; h$r16 = x14; h$r15 = x15; h$r14 = x16; h$r13 = x17; h$r12 = x18; h$r11 = x19; h$r10 = x20; h$r9 = x21; h$r8 = x22; h$r7 = x23; h$r6 = x24; h$r5 = x25; h$r4 = x26; h$r3 = x27; h$r2 = x28; h$r1 = x29; }; function h$l30(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30) { h$r30 = x1; h$r29 = x2; h$r28 = x3; h$r27 = x4; h$r26 = x5; h$r25 = x6; h$r24 = x7; h$r23 = x8; h$r22 = x9; h$r21 = x10; h$r20 = x11; h$r19 = x12; h$r18 = x13; h$r17 = x14; h$r16 = x15; h$r15 = x16; h$r14 = x17; h$r13 = x18; h$r12 = x19; h$r11 = x20; h$r10 = x21; h$r9 = x22; h$r8 = x23; h$r7 = x24; h$r6 = x25; h$r5 = x26; h$r4 = x27; h$r3 = x28; h$r2 = x29; h$r1 = x30; }; function h$l31(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31) { h$r31 = x1; h$r30 = x2; h$r29 = x3; h$r28 = x4; h$r27 = x5; h$r26 = x6; h$r25 = x7; h$r24 = x8; h$r23 = x9; h$r22 = x10; h$r21 = x11; h$r20 = x12; h$r19 = x13; h$r18 = x14; h$r17 = x15; h$r16 = x16; h$r15 = x17; h$r14 = x18; h$r13 = x19; h$r12 = x20; h$r11 = x21; h$r10 = x22; h$r9 = x23; h$r8 = x24; h$r7 = x25; h$r6 = x26; h$r5 = x27; h$r4 = x28; h$r3 = x29; h$r2 = x30; h$r1 = x31; }; function h$l32(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32) { h$r32 = x1; h$r31 = x2; h$r30 = x3; h$r29 = x4; h$r28 = x5; h$r27 = x6; h$r26 = x7; h$r25 = x8; h$r24 = x9; h$r23 = x10; h$r22 = x11; h$r21 = x12; h$r20 = x13; h$r19 = x14; h$r18 = x15; h$r17 = x16; h$r16 = x17; h$r15 = x18; h$r14 = x19; h$r13 = x20; h$r12 = x21; h$r11 = x22; h$r10 = x23; h$r9 = x24; h$r8 = x25; h$r7 = x26; h$r6 = x27; h$r5 = x28; h$r4 = x29; h$r3 = x30; h$r2 = x31; h$r1 = x32; }; var h$ret1; var h$ret2; var h$ret3; var h$ret4; var h$ret5; var h$ret6; var h$ret7; var h$ret8; var h$ret9; var h$ret10; /* platform-specific setup */ // top-level debug initialization needs this. declare it in case we aren't in the same file as out.js function h$ghcjszmprimZCGHCJSziPrimziJSVal_con_e() { return h$stack[h$sp]; }; /* if browser mode is active (GHCJS_BROWSER is defined), all the runtime platform detection code should be removed by the preprocessor. The h$isPlatform variables are undeclared. in non-browser mode, use h$isNode, h$isJsShell, h$isBrowser to find the current platform. more platforms should be added here in the future */ var h$isNode = false; // runtime is node.js var h$isJvm = false; // runtime is JVM var h$isJsShell = false; // runtime is SpiderMonkey jsshell var h$isJsCore = false; // runtime is JavaScriptCore jsc var h$isBrowser = false; // running in browser or everything else var h$isGHCJSi = false; // Code is GHCJSi (browser or node) // load all required node.js modules if(typeof process !== 'undefined' && (typeof h$TH !== 'undefined' || (typeof require !== 'undefined' && typeof module !== 'undefined' && module.exports))) { h$isNode = true; // we have to use these names for the closure compiler externs to work var fs = require('fs'); var path = require('path'); var os = require('os'); var child_process = require('child_process'); var h$fs = fs; var h$path = path; var h$os = os; var h$child = child_process; var h$process = process; function h$getProcessConstants() { // this is a non-public API, but we need these values for things like file access modes var cs = process['binding']('constants'); if(typeof cs.os === 'object' && typeof cs.fs === 'object') { return cs; } else { // earlier node.js versions (4.x and older) have all constants directly in the constants object // construct something that resembles the hierarchy of the object in new versions: return { 'fs': cs , 'crypto': cs , 'os': { 'UV_UDP_REUSEADDR': cs['UV_UDP_REUSEADDR'] , 'errno': cs , 'signals': cs } }; } } var h$processConstants = h$getProcessConstants(); } else if(typeof Java !== 'undefined') { h$isJvm = true; this.console = { log: function(s) { java.lang.System.out.print(s); } }; } else if(typeof snarf !== 'undefined' && typeof evalInFrame !== 'undefined' && typeof countHeap !== 'undefined') { h$isJsShell = true; this.console = { log: this.print }; } else if(typeof numberOfDFGCompiles !== 'undefined' && typeof jscStack !== 'undefined') { h$isJsCore = true; } else { h$isBrowser = true; } if(typeof global !== 'undefined' && global.h$GHCJSi) { h$isGHCJSi = true; } function h$getGlobal(that) { if(typeof global !== 'undefined') return global; return that; } /* set up the google closure library. this is a rather hacky setup to make it work with our shims without requiring compilation or pulling in the google closure library module loader */ var goog = {}; goog.global = h$getGlobal(this); goog.provide = function() { }; goog.require = function() { }; goog.isDef = function(val) { return val !== undefined; }; goog.inherits = function(childCtor, parentCtor) { /** @constructor */ function tempCtor() {}; tempCtor.prototype = parentCtor.prototype; childCtor.superClass_ = parentCtor.prototype; childCtor.prototype = new tempCtor(); /** @override */ childCtor.prototype.constructor = childCtor; /** * Calls superclass constructor/method. * * This function is only available if you use goog.inherits to * express inheritance relationships between classes. * * NOTE: This is a replacement for goog.base and for superClass_ * property defined in childCtor. * * @param {!Object} me Should always be "this". * @param {string} methodName The method name to call. Calling * superclass constructor can be done with the special string * 'constructor'. * @param {...*} var_args The arguments to pass to superclass * method/constructor. * @return {*} The return value of the superclass method/constructor. */ childCtor.base = function(me, methodName, var_args) { // Copying using loop to avoid deop due to passing arguments object to // function. This is faster in many JS engines as of late 2014. var args = new Array(arguments.length - 2); for (var i = 2; i < arguments.length; i++) { args[i - 2] = arguments[i]; } return parentCtor.prototype[methodName].apply(me, args); }; }; goog.isString = function(v) { return typeof v === 'string'; } goog.math = {}; goog.crypt = {}; /* Copyright (c) 2010, Linden Research, Inc. Copyright (c) 2014, Joshua Bell Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. $/LicenseInfo$ */ // Original can be found at: // https://bitbucket.org/lindenlab/llsd // Modifications by Joshua Bell inexorabletash@gmail.com // https://github.com/inexorabletash/polyfill // ES3/ES5 implementation of the Krhonos Typed Array Specification // Ref: http://www.khronos.org/registry/typedarray/specs/latest/ // Date: 2011-02-01 // // Variations: // * Allows typed_array.get/set() as alias for subscripts (typed_array[]) // * Gradually migrating structure from Khronos spec to ES6 spec (function(global) { 'use strict'; var undefined = (void 0); // Paranoia // Beyond this value, index getters/setters (i.e. array[0], array[1]) are so slow to // create, and consume so much memory, that the browser appears frozen. var MAX_ARRAY_LENGTH = 1e5; // Approximations of internal ECMAScript conversion functions function Type(v) { switch(typeof v) { case 'undefined': return 'undefined'; case 'boolean': return 'boolean'; case 'number': return 'number'; case 'string': return 'string'; default: return v === null ? 'null' : 'object'; } } // Class returns internal [[Class]] property, used to avoid cross-frame instanceof issues: function Class(v) { return Object.prototype.toString.call(v).replace(/^\[object *|\]$/g, ''); } function IsCallable(o) { return typeof o === 'function'; } function ToObject(v) { if (v === null || v === undefined) throw TypeError(); return Object(v); } function ToInt32(v) { return v >> 0; } function ToUint32(v) { return v >>> 0; } // Snapshot intrinsics var LN2 = Math.LN2, abs = Math.abs, floor = Math.floor, log = Math.log, max = Math.max, min = Math.min, pow = Math.pow, round = Math.round; // emulate ES5 getter/setter API using legacy APIs // http://blogs.msdn.com/b/ie/archive/2010/09/07/transitioning-existing-code-to-the-es5-getter-setter-apis.aspx // (second clause tests for Object.defineProperty() in IE<9 that only supports extending DOM prototypes, but // note that IE<9 does not support __defineGetter__ or __defineSetter__ so it just renders the method harmless) (function() { var orig = Object.defineProperty; var dom_only = !(function(){try{return Object.defineProperty({},'x',{});}catch(_){return false;}}()); if (!orig || dom_only) { Object.defineProperty = function (o, prop, desc) { // In IE8 try built-in implementation for defining properties on DOM prototypes. if (orig) try { return orig(o, prop, desc); } catch (_) {} if (o !== Object(o)) throw TypeError('Object.defineProperty called on non-object'); if (Object.prototype.__defineGetter__ && ('get' in desc)) Object.prototype.__defineGetter__.call(o, prop, desc.get); if (Object.prototype.__defineSetter__ && ('set' in desc)) Object.prototype.__defineSetter__.call(o, prop, desc.set); if ('value' in desc) o[prop] = desc.value; return o; }; } }()); // ES5: Make obj[index] an alias for obj._getter(index)/obj._setter(index, value) // for index in 0 ... obj.length function makeArrayAccessors(obj) { if (obj.length > MAX_ARRAY_LENGTH) throw RangeError('Array too large for polyfill'); function makeArrayAccessor(index) { Object.defineProperty(obj, index, { 'get': function() { return obj._getter(index); }, 'set': function(v) { obj._setter(index, v); }, enumerable: true, configurable: false }); } var i; for (i = 0; i < obj.length; i += 1) { makeArrayAccessor(i); } } // Internal conversion functions: // pack<Type>() - take a number (interpreted as Type), output a byte array // unpack<Type>() - take a byte array, output a Type-like number function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; } function as_unsigned(value, bits) { var s = 32 - bits; return (value << s) >>> s; } function packI8(n) { return [n & 0xff]; } function unpackI8(bytes) { return as_signed(bytes[0], 8); } function packU8(n) { return [n & 0xff]; } function unpackU8(bytes) { return as_unsigned(bytes[0], 8); } function packU8Clamped(n) { n = round(Number(n)); return [n < 0 ? 0 : n > 0xff ? 0xff : n & 0xff]; } function packI16(n) { return [n & 0xff, (n >> 8) & 0xff]; } function unpackI16(bytes) { return as_signed(bytes[1] << 8 | bytes[0], 16); } function packU16(n) { return [n & 0xff, (n >> 8) & 0xff]; } function unpackU16(bytes) { return as_unsigned(bytes[1] << 8 | bytes[0], 16); } function packI32(n) { return [n & 0xff, (n >> 8) & 0xff, (n >> 16) & 0xff, (n >> 24) & 0xff]; } function unpackI32(bytes) { return as_signed(bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0], 32); } function packU32(n) { return [n & 0xff, (n >> 8) & 0xff, (n >> 16) & 0xff, (n >> 24) & 0xff]; } function unpackU32(bytes) { return as_unsigned(bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0], 32); } function packIEEE754(v, ebits, fbits) { var bias = (1 << (ebits - 1)) - 1, s, e, f, ln, i, bits, str, bytes; function roundToEven(n) { var w = floor(n), f = n - w; if (f < 0.5) return w; if (f > 0.5) return w + 1; return w % 2 ? w + 1 : w; } // Compute sign, exponent, fraction if (v !== v) { // NaN // http://dev.w3.org/2006/webapi/WebIDL/#es-type-mapping e = (1 << ebits) - 1; f = pow(2, fbits - 1); s = 0; } else if (v === Infinity || v === -Infinity) { e = (1 << ebits) - 1; f = 0; s = (v < 0) ? 1 : 0; } else if (v === 0) { e = 0; f = 0; s = (1 / v === -Infinity) ? 1 : 0; } else { s = v < 0; v = abs(v); if (v >= pow(2, 1 - bias)) { e = min(floor(log(v) / LN2), 1023); var significand = v / pow(2, e); if (significand < 1) { e -= 1; significand *= 2; } if (significand >= 2) { e += 1; significand /= 2; } f = roundToEven(significand * pow(2, fbits)); if (f / pow(2, fbits) >= 2) { e = e + 1; f = 1; } if (e > bias) { // Overflow e = (1 << ebits) - 1; f = 0; } else { // Normalized e = e + bias; f = f - pow(2, fbits); } } else { // Denormalized e = 0; f = roundToEven(v / pow(2, 1 - bias - fbits)); } } // Pack sign, exponent, fraction bits = []; for (i = fbits; i; i -= 1) { bits.push(f % 2 ? 1 : 0); f = floor(f / 2); } for (i = ebits; i; i -= 1) { bits.push(e % 2 ? 1 : 0); e = floor(e / 2); } bits.push(s ? 1 : 0); bits.reverse(); str = bits.join(''); // Bits to bytes bytes = []; while (str.length) { bytes.unshift(parseInt(str.substring(0, 8), 2)); str = str.substring(8); } return bytes; } function unpackIEEE754(bytes, ebits, fbits) { // Bytes to bits var bits = [], i, j, b, str, bias, s, e, f; for (i = 0; i < bytes.length; ++i) { b = bytes[i]; for (j = 8; j; j -= 1) { bits.push(b % 2 ? 1 : 0); b = b >> 1; } } bits.reverse(); str = bits.join(''); // Unpack sign, exponent, fraction bias = (1 << (ebits - 1)) - 1; s = parseInt(str.substring(0, 1), 2) ? -1 : 1; e = parseInt(str.substring(1, 1 + ebits), 2); f = parseInt(str.substring(1 + ebits), 2); // Produce number if (e === (1 << ebits) - 1) { return f !== 0 ? NaN : s * Infinity; } else if (e > 0) { // Normalized return s * pow(2, e - bias) * (1 + f / pow(2, fbits)); } else if (f !== 0) { // Denormalized return s * pow(2, -(bias - 1)) * (f / pow(2, fbits)); } else { return s < 0 ? -0 : 0; } } function unpackF64(b) { return unpackIEEE754(b, 11, 52); } function packF64(v) { return packIEEE754(v, 11, 52); } function unpackF32(b) { return unpackIEEE754(b, 8, 23); } function packF32(v) { return packIEEE754(v, 8, 23); } // // 3 The ArrayBuffer Type // (function() { function ArrayBuffer(length) { length = ToInt32(length); if (length < 0) throw RangeError('ArrayBuffer size is not a small enough positive integer.'); Object.defineProperty(this, 'byteLength', {value: length}); Object.defineProperty(this, '_bytes', {value: Array(length)}); for (var i = 0; i < length; i += 1) this._bytes[i] = 0; } global.ArrayBuffer = global.ArrayBuffer || ArrayBuffer; // // 5 The Typed Array View Types // function $TypedArray$() { // %TypedArray% ( length ) if (!arguments.length || typeof arguments[0] !== 'object') { return (function(length) { length = ToInt32(length); if (length < 0) throw RangeError('length is not a small enough positive integer.'); Object.defineProperty(this, 'length', {value: length}); Object.defineProperty(this, 'byteLength', {value: length * this.BYTES_PER_ELEMENT}); Object.defineProperty(this, 'buffer', {value: new ArrayBuffer(this.byteLength)}); Object.defineProperty(this, 'byteOffset', {value: 0}); }).apply(this, arguments); } // %TypedArray% ( typedArray ) if (arguments.length >= 1 && Type(arguments[0]) === 'object' && arguments[0] instanceof $TypedArray$) { return (function(typedArray){ if (this.constructor !== typedArray.constructor) throw TypeError(); var byteLength = typedArray.length * this.BYTES_PER_ELEMENT; Object.defineProperty(this, 'buffer', {value: new ArrayBuffer(byteLength)}); Object.defineProperty(this, 'byteLength', {value: byteLength}); Object.defineProperty(this, 'byteOffset', {value: 0}); Object.defineProperty(this, 'length', {value: typedArray.length}); for (var i = 0; i < this.length; i += 1) this._setter(i, typedArray._getter(i)); }).apply(this, arguments); } // %TypedArray% ( array ) if (arguments.length >= 1 && Type(arguments[0]) === 'object' && !(arguments[0] instanceof $TypedArray$) && !(arguments[0] instanceof ArrayBuffer || Class(arguments[0]) === 'ArrayBuffer')) { return (function(array) { var byteLength = array.length * this.BYTES_PER_ELEMENT; Object.defineProperty(this, 'buffer', {value: new ArrayBuffer(byteLength)}); Object.defineProperty(this, 'byteLength', {value: byteLength}); Object.defineProperty(this, 'byteOffset', {value: 0}); Object.defineProperty(this, 'length', {value: array.length}); for (var i = 0; i < this.length; i += 1) { var s = array[i]; this._setter(i, Number(s)); } }).apply(this, arguments); } // %TypedArray% ( buffer, byteOffset=0, length=undefined ) if (arguments.length >= 1 && Type(arguments[0]) === 'object' && (arguments[0] instanceof ArrayBuffer || Class(arguments[0]) === 'ArrayBuffer')) { return (function(buffer, byteOffset, length) { byteOffset = ToUint32(byteOffset); if (byteOffset > buffer.byteLength) throw RangeError('byteOffset out of range'); // The given byteOffset must be a multiple of the element // size of the specific type, otherwise an exception is raised. if (byteOffset % this.BYTES_PER_ELEMENT) throw RangeError('buffer length minus the byteOffset is not a multiple of the element size.'); if (length === undefined) { var byteLength = buffer.byteLength - byteOffset; if (byteLength % this.BYTES_PER_ELEMENT) throw RangeError('length of buffer minus byteOffset not a multiple of the element size'); length = byteLength / this.BYTES_PER_ELEMENT; } else { length = ToUint32(length); byteLength = length * this.BYTES_PER_ELEMENT; } if ((byteOffset + byteLength) > buffer.byteLength) throw RangeError('byteOffset and length reference an area beyond the end of the buffer'); Object.defineProperty(this, 'buffer', {value: buffer}); Object.defineProperty(this, 'byteLength', {value: byteLength}); Object.defineProperty(this, 'byteOffset', {value: byteOffset}); Object.defineProperty(this, 'length', {value: length}); }).apply(this, arguments); } // %TypedArray% ( all other argument combinations ) throw TypeError(); } // Properties of the %TypedArray Instrinsic Object // %TypedArray%.from ( source , mapfn=undefined, thisArg=undefined ) Object.defineProperty($TypedArray$, 'from', {value: function(iterable) { return new this(iterable); }}); // %TypedArray%.of ( ...items ) Object.defineProperty($TypedArray$, 'of', {value: function(/*...items*/) { return new this(arguments); }}); // %TypedArray%.prototype var $TypedArrayPrototype$ = {}; $TypedArray$.prototype = $TypedArrayPrototype$; // WebIDL: getter type (unsigned long index); Object.defineProperty($TypedArray$.prototype, '_getter', {value: function(index) { if (arguments.length < 1) throw SyntaxError('Not enough arguments'); index = ToUint32(index); if (index >= this.length) return undefined; var bytes = [], i, o; for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i < this.BYTES_PER_ELEMENT; i += 1, o += 1) { bytes.push(this.buffer._bytes[o]); } return this._unpack(bytes); }}); // NONSTANDARD: convenience alias for getter: type get(unsigned long index); Object.defineProperty($TypedArray$.prototype, 'get', {value: $TypedArray$.prototype._getter}); // WebIDL: setter void (unsigned long index, type value); Object.defineProperty($TypedArray$.prototype, '_setter', {value: function(index, value) { if (arguments.length < 2) throw SyntaxError('Not enough arguments'); index = ToUint32(index); if (index >= this.length) return; var bytes = this._pack(value), i, o; for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i < this.BYTES_PER_ELEMENT; i += 1, o += 1) { this.buffer._bytes[o] = bytes[i]; } }}); // get %TypedArray%.prototype.buffer // get %TypedArray%.prototype.byteLength // get %TypedArray%.prototype.byteOffset // -- applied directly to the object in the constructor // %TypedArray%.prototype.constructor Object.defineProperty($TypedArray$.prototype, 'constructor', {value: $TypedArray$}); // %TypedArray%.prototype.copyWithin (target, start, end = this.length ) Object.defineProperty($TypedArray$.prototype, 'copyWithin', {value: function(target, start) { var end = arguments[2]; var o = ToObject(this); var lenVal = o.length; var len = ToUint32(lenVal); len = max(len, 0); var relativeTarget = ToInt32(target); var to; if (relativeTarget < 0) to = max(len + relativeTarget, 0); else to = min(relativeTarget, len); var relativeStart = ToInt32(start); var from; if (relativeStart < 0) from = max(len + relativeStart, 0); else from = min(relativeStart, len); var relativeEnd; if (end === undefined) relativeEnd = len; else relativeEnd = ToInt32(end); var final0; if (relativeEnd < 0) final0 = max(len + relativeEnd, 0); else final0 = min(relativeEnd, len); var count = min(final0 - from, len - to); var direction; if (from < to && to < from + count) { direction = -1; from = from + count - 1; to = to + count - 1; } else { direction = 1; } while (count > 0) { o._setter(to, o._getter(from)); from = from + direction; to = to + direction; count = count - 1; } return o; }}); // %TypedArray%.prototype.entries ( ) // -- defined in es6.js to shim browsers w/ native TypedArrays // %TypedArray%.prototype.every ( callbackfn, thisArg = undefined ) Object.defineProperty($TypedArray$.prototype, 'every', {value: function(callbackfn) { if (this === undefined || this === null) throw TypeError(); var t = Object(this); var len = ToUint32(t.length); if (!IsCallable(callbackfn)) throw TypeError(); var thisArg = arguments[1]; for (var i = 0; i < len; i++) { if (!callbackfn.call(thisArg, t._getter(i), i, t)) return false; } return true; }}); // %TypedArray%.prototype.fill (value, start = 0, end = this.length ) Object.defineProperty($TypedArray$.prototype, 'fill', {value: function(value) { var start = arguments[1], end = arguments[2]; var o = ToObject(this); var lenVal = o.length; var len = ToUint32(lenVal); len = max(len, 0); var relativeStart = ToInt32(start); var k; if (relativeStart < 0) k = max((len + relativeStart), 0); else k = min(relativeStart, len); var relativeEnd; if (end === undefined) relativeEnd = len; else relativeEnd = ToInt32(end); var final0; if (relativeEnd < 0) final0 = max((len + relativeEnd), 0); else final0 = min(relativeEnd, len); while (k < final0) { o._setter(k, value); k += 1; } return o; }}); // %TypedArray%.prototype.filter ( callbackfn, thisArg = undefined ) Object.defineProperty($TypedArray$.prototype, 'filter', {value: function(callbackfn) { if (this === undefined || this === null) throw TypeError(); var t = Object(this); var len = ToUint32(t.length); if (!IsCallable(callbackfn)) throw TypeError(); var res = []; var thisp = arguments[1]; for (var i = 0; i < len; i++) { var val = t._getter(i); // in case fun mutates this if (callbackfn.call(thisp, val, i, t)) res.push(val); } return new this.constructor(res); }}); // %TypedArray%.prototype.find (predicate, thisArg = undefined) Object.defineProperty($TypedArray$.prototype, 'find', {value: function(predicate) { var o = ToObject(this); var lenValue = o.length; var len = ToUint32(lenValue); if (!IsCallable(predicate)) throw TypeError(); var t = arguments.length > 1 ? arguments[1] : undefined; var k = 0; while (k < len) { var kValue = o._getter(k); var testResult = predicate.call(t, kValue, k, o); if (Boolean(testResult)) return kValue; ++k; } return undefined; }}); // %TypedArray%.prototype.findIndex ( predicate, thisArg = undefined ) Object.defin