porffor 0.18.34 → 0.18.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,7 +46,6 @@ export const __ByteString_prototype_toUpperCase = (_this: bytestring) => {
46
46
  return out;
47
47
  };
48
48
 
49
-
50
49
  export const __String_prototype_toLowerCase = (_this: string) => {
51
50
  // todo: unicode not just ascii
52
51
  const len: i32 = _this.length;
@@ -92,6 +91,43 @@ export const __ByteString_prototype_toLowerCase = (_this: bytestring) => {
92
91
  return out;
93
92
  };
94
93
 
94
+ export const __String_prototype_toLocaleUpperCase = (_this: string) => __String_prototype_toUpperCase(_this);
95
+ export const __ByteString_prototype_toLocaleUpperCase = (_this: bytestring) => __ByteString_prototype_toLowerCase(_this);
96
+ export const __String_prototype_toLocaleLowerCase = (_this: string) => __String_prototype_toUpperCase(_this);
97
+ export const __ByteString_prototype_toLocaleLowerCase = (_this: bytestring) => __ByteString_prototype_toLowerCase(_this);
98
+
99
+ export const __String_prototype_codePointAt = (_this: string, index: number) => {
100
+ const len: i32 = _this.length;
101
+
102
+ index |= 0;
103
+ if (Porffor.fastOr(index < 0, index >= len)) return undefined;
104
+
105
+ index *= 2;
106
+ const c1: i32 = Porffor.wasm.i32.load16_u(Porffor.wasm`local.get ${_this}` + index, 0, 4);
107
+ if (Porffor.fastAnd(c1 >= 0xD800, c1 <= 0xDBFF)) {
108
+ // 1st char is leading surrogate, handle 2nd char
109
+ // check oob
110
+ if (index + 1 >= len) return c1;
111
+
112
+ const c2: i32 = Porffor.wasm.i32.load16_u(Porffor.wasm`local.get ${_this}` + index + 2, 0, 4);
113
+ if (Porffor.fastAnd(c2 >= 0xDC00, c2 <= 0xDFFF)) {
114
+ // 2nd char is trailing surrogate, return code point
115
+ return (c1 << 10) + c2 - 56613888;
116
+ }
117
+ }
118
+
119
+ return c1;
120
+ };
121
+
122
+ export const __ByteString_prototype_codePointAt = (_this: bytestring, index: number) => {
123
+ const len: i32 = _this.length;
124
+
125
+ index |= 0;
126
+ if (Porffor.fastOr(index < 0, index >= len)) return undefined;
127
+
128
+ // bytestrings cannot have surrogates, so just do charCodeAt
129
+ return Porffor.wasm.i32.load8_u(Porffor.wasm`local.get ${_this}` + index, 0, 4);
130
+ };
95
131
 
96
132
  export const __String_prototype_startsWith = (_this: string, searchString: string, position: number) => {
97
133
  // todo: handle bytestring searchString
@@ -1177,6 +1213,245 @@ memory.copy 0 0`;
1177
1213
  };
1178
1214
 
1179
1215
 
1216
+ export const __String_prototype_split = (_this: string, separator: any, limit: any) => {
1217
+ let out: any[] = Porffor.allocate(), outLen: i32 = 0;
1218
+ const sType: i32 = Porffor.TYPES.string;
1219
+
1220
+ if (Porffor.wasm`local.get ${limit+1}` == Porffor.TYPES.undefined) limit = Number.MAX_SAFE_INTEGER;
1221
+ limit |= 0;
1222
+ if (limit < 0) limit = Number.MAX_SAFE_INTEGER;
1223
+
1224
+ let tmp: string = Porffor.allocate(), tmpLen: i32 = 0;
1225
+ const thisLen: i32 = _this.length * 2, sepLen: i32 = separator.length;
1226
+ if (sepLen == 1) {
1227
+ // fast path: single char separator
1228
+ const sepChar: i32 = separator.charCodeAt(0);
1229
+ for (let i: i32 = 0; i < thisLen; i += 2) {
1230
+ const x: i32 = Porffor.wasm.i32.load16_u(Porffor.wasm`local.get ${_this}` + i, 0, 4);
1231
+
1232
+ if (x == sepChar) {
1233
+ if (outLen >= limit) {
1234
+ out.length = outLen;
1235
+ return out;
1236
+ }
1237
+
1238
+ tmp.length = tmpLen;
1239
+ Porffor.wasm`
1240
+ local.get ${out}
1241
+ local.get ${outLen}
1242
+ i32.const 9
1243
+ i32.mul
1244
+ i32.add
1245
+ local.get ${tmp}
1246
+ f64.convert_i32_u
1247
+ f64.store 0 4
1248
+
1249
+ local.get ${out}
1250
+ local.get ${outLen}
1251
+ i32.const 9
1252
+ i32.mul
1253
+ i32.add
1254
+ local.get ${sType}
1255
+ i32.store8 0 12`;
1256
+ outLen++;
1257
+
1258
+ tmp = Porffor.allocate();
1259
+ tmpLen = 0;
1260
+ continue;
1261
+ }
1262
+
1263
+ Porffor.wasm.i32.store16(Porffor.wasm`local.get ${tmp}` + tmpLen * 2, x, 0, 4);
1264
+ tmpLen++;
1265
+ }
1266
+ } else {
1267
+ let sepInd: i32 = 0;
1268
+ for (let i: i32 = 0; i < thisLen; i += 2) {
1269
+ const x: i32 = Porffor.wasm.i32.load16_u(Porffor.wasm`local.get ${_this}` + i, 0, 4);
1270
+
1271
+ if (x == separator.charCodeAt(sepInd)) {
1272
+ if (++sepInd == sepLen) {
1273
+ if (outLen >= limit) {
1274
+ out.length = outLen;
1275
+ return out;
1276
+ }
1277
+
1278
+ tmp.length = tmpLen - (sepLen - 1);
1279
+ Porffor.wasm`
1280
+ local.get ${out}
1281
+ local.get ${outLen}
1282
+ i32.const 9
1283
+ i32.mul
1284
+ i32.add
1285
+ local.get ${tmp}
1286
+ f64.convert_i32_u
1287
+ f64.store 0 4
1288
+
1289
+ local.get ${out}
1290
+ local.get ${outLen}
1291
+ i32.const 9
1292
+ i32.mul
1293
+ i32.add
1294
+ local.get ${sType}
1295
+ i32.store8 0 12`;
1296
+ outLen++;
1297
+
1298
+ tmp = Porffor.allocate();
1299
+ tmpLen = 0;
1300
+ continue;
1301
+ }
1302
+ } else sepInd = 0;
1303
+
1304
+ Porffor.wasm.i32.store16(Porffor.wasm`local.get ${tmp}` + tmpLen, x, 0, 4);
1305
+ tmpLen++;
1306
+ }
1307
+ }
1308
+
1309
+ if (tmpLen > 0 && outLen < limit) {
1310
+ tmp.length = tmpLen;
1311
+ Porffor.wasm`
1312
+ local.get ${out}
1313
+ local.get ${outLen}
1314
+ i32.const 9
1315
+ i32.mul
1316
+ i32.add
1317
+ local.get ${tmp}
1318
+ f64.convert_i32_u
1319
+ f64.store 0 4
1320
+
1321
+ local.get ${out}
1322
+ local.get ${outLen}
1323
+ i32.const 9
1324
+ i32.mul
1325
+ i32.add
1326
+ local.get ${sType}
1327
+ i32.store8 0 12`;
1328
+ outLen++;
1329
+ }
1330
+
1331
+ out.length = outLen;
1332
+ return out;
1333
+ };
1334
+
1335
+ export const __ByteString_prototype_split = (_this: bytestring, separator: any, limit: any) => {
1336
+ let out: any[] = Porffor.allocate(), outLen: i32 = 0;
1337
+ const bsType: i32 = Porffor.TYPES.bytestring;
1338
+
1339
+ if (Porffor.wasm`local.get ${limit+1}` == Porffor.TYPES.undefined) limit = Number.MAX_SAFE_INTEGER;
1340
+ limit |= 0;
1341
+ if (limit < 0) limit = Number.MAX_SAFE_INTEGER;
1342
+
1343
+ let tmp: bytestring = Porffor.allocate(), tmpLen: i32 = 0;
1344
+ const thisLen: i32 = _this.length, sepLen: i32 = separator.length;
1345
+ if (sepLen == 1) {
1346
+ // fast path: single char separator
1347
+ const sepChar: i32 = separator.charCodeAt(0);
1348
+ for (let i: i32 = 0; i < thisLen; i++) {
1349
+ const x: i32 = Porffor.wasm.i32.load8_u(Porffor.wasm`local.get ${_this}` + i, 0, 4);
1350
+
1351
+ if (x == sepChar) {
1352
+ if (outLen >= limit) {
1353
+ out.length = outLen;
1354
+ return out;
1355
+ }
1356
+
1357
+ tmp.length = tmpLen;
1358
+ Porffor.wasm`
1359
+ local.get ${out}
1360
+ local.get ${outLen}
1361
+ i32.const 9
1362
+ i32.mul
1363
+ i32.add
1364
+ local.get ${tmp}
1365
+ f64.convert_i32_u
1366
+ f64.store 0 4
1367
+
1368
+ local.get ${out}
1369
+ local.get ${outLen}
1370
+ i32.const 9
1371
+ i32.mul
1372
+ i32.add
1373
+ local.get ${bsType}
1374
+ i32.store8 0 12`;
1375
+ outLen++;
1376
+
1377
+ tmp = Porffor.allocate();
1378
+ tmpLen = 0;
1379
+ continue;
1380
+ }
1381
+
1382
+ Porffor.wasm.i32.store8(Porffor.wasm`local.get ${tmp}` + tmpLen, x, 0, 4);
1383
+ tmpLen++;
1384
+ }
1385
+ } else {
1386
+ let sepInd: i32 = 0;
1387
+ for (let i: i32 = 0; i < thisLen; i++) {
1388
+ const x: i32 = Porffor.wasm.i32.load8_u(Porffor.wasm`local.get ${_this}` + i, 0, 4);
1389
+
1390
+ if (x == separator.charCodeAt(sepInd)) {
1391
+ if (++sepInd == sepLen) {
1392
+ if (outLen >= limit) {
1393
+ out.length = outLen;
1394
+ return out;
1395
+ }
1396
+
1397
+ tmp.length = tmpLen - (sepLen - 1);
1398
+ Porffor.wasm`
1399
+ local.get ${out}
1400
+ local.get ${outLen}
1401
+ i32.const 9
1402
+ i32.mul
1403
+ i32.add
1404
+ local.get ${tmp}
1405
+ f64.convert_i32_u
1406
+ f64.store 0 4
1407
+
1408
+ local.get ${out}
1409
+ local.get ${outLen}
1410
+ i32.const 9
1411
+ i32.mul
1412
+ i32.add
1413
+ local.get ${bsType}
1414
+ i32.store8 0 12`;
1415
+ outLen++;
1416
+
1417
+ tmp = Porffor.allocate();
1418
+ tmpLen = 0;
1419
+ continue;
1420
+ }
1421
+ } else sepInd = 0;
1422
+
1423
+ Porffor.wasm.i32.store8(Porffor.wasm`local.get ${tmp}` + tmpLen, x, 0, 4);
1424
+ tmpLen++;
1425
+ }
1426
+ }
1427
+
1428
+ if (tmpLen > 0 && outLen < limit) {
1429
+ tmp.length = tmpLen;
1430
+ Porffor.wasm`
1431
+ local.get ${out}
1432
+ local.get ${outLen}
1433
+ i32.const 9
1434
+ i32.mul
1435
+ i32.add
1436
+ local.get ${tmp}
1437
+ f64.convert_i32_u
1438
+ f64.store 0 4
1439
+
1440
+ local.get ${out}
1441
+ local.get ${outLen}
1442
+ i32.const 9
1443
+ i32.mul
1444
+ i32.add
1445
+ local.get ${bsType}
1446
+ i32.store8 0 12`;
1447
+ outLen++;
1448
+ }
1449
+
1450
+ out.length = outLen;
1451
+ return out;
1452
+ };
1453
+
1454
+
1180
1455
  // 22.1.3.29 String.prototype.toString ()
1181
1456
  // https://tc39.es/ecma262/#sec-string.prototype.tostring
1182
1457
  export const __String_prototype_toString = (_this: string) => {
@@ -1506,6 +1506,42 @@ export const BuiltinFuncs = function() {
1506
1506
  returns: [127,127], typedReturns: 1,
1507
1507
  locals: [127,127,127,127,127,127,127], localNames: ["_this","_this#type","len","out","#last_type","i","j","endPtr","chr"],
1508
1508
  };
1509
+ this.__String_prototype_toLocaleUpperCase = {
1510
+ wasm: (scope, {builtin}) => [[32,0],[65,194,0],[16, builtin('__String_prototype_toUpperCase')],[34,2],[15]],
1511
+ params: [127,127], typedParams: 1,
1512
+ returns: [127,127], typedReturns: 1,
1513
+ locals: [127], localNames: ["_this","_this#type","#last_type"],
1514
+ };
1515
+ this.__ByteString_prototype_toLocaleUpperCase = {
1516
+ wasm: (scope, {builtin}) => [[32,0],[65,194,1],[16, builtin('__ByteString_prototype_toLowerCase')],[34,2],[15]],
1517
+ params: [127,127], typedParams: 1,
1518
+ returns: [127,127], typedReturns: 1,
1519
+ locals: [127], localNames: ["_this","_this#type","#last_type"],
1520
+ };
1521
+ this.__String_prototype_toLocaleLowerCase = {
1522
+ wasm: (scope, {builtin}) => [[32,0],[65,194,0],[16, builtin('__String_prototype_toUpperCase')],[34,2],[15]],
1523
+ params: [127,127], typedParams: 1,
1524
+ returns: [127,127], typedReturns: 1,
1525
+ locals: [127], localNames: ["_this","_this#type","#last_type"],
1526
+ };
1527
+ this.__ByteString_prototype_toLocaleLowerCase = {
1528
+ wasm: (scope, {builtin}) => [[32,0],[65,194,1],[16, builtin('__ByteString_prototype_toLowerCase')],[34,2],[15]],
1529
+ params: [127,127], typedParams: 1,
1530
+ returns: [127,127], typedReturns: 1,
1531
+ locals: [127], localNames: ["_this","_this#type","#last_type"],
1532
+ };
1533
+ this.__String_prototype_codePointAt = {
1534
+ wasm: (scope, {}) => [[32,0],[40,1,0],[33,4],[32,2],[65,0],[114],[34,2],[65,0],[72],[32,2],[32,4],[78],[114],[4,64],[65,0],[65,3],[15],[11],[32,2],[65,2],[108],[33,2],[32,0],[32,2],[106],[47,0,4],[34,5],[65,128,176,3],[78],[32,5],[65,255,183,3],[76],[113],[4,64],[32,2],[65,1],[106],[32,4],[78],[4,64],[32,5],[65,0],[15],[11],[32,0],[32,2],[106],[65,2],[106],[47,0,4],[34,6],[65,128,184,3],[78],[32,6],[65,255,191,3],[76],[113],[4,64],[32,5],[65,10],[116],[32,6],[106],[65,128,184,255,26],[107],[65,0],[15],[11],[11],[32,5],[65,0],[15]],
1535
+ params: [127,127,127,127], typedParams: 1,
1536
+ returns: [127,127], typedReturns: 1,
1537
+ locals: [127,127,127], localNames: ["_this","_this#type","index","index#type","len","c1","c2"],
1538
+ };
1539
+ this.__ByteString_prototype_codePointAt = {
1540
+ wasm: (scope, {}) => [[32,0],[40,1,0],[33,4],[32,2],[65,0],[114],[34,2],[65,0],[72],[32,2],[32,4],[78],[114],[4,64],[65,0],[65,3],[15],[11],[32,0],[32,2],[106],[45,0,4],[65,0],[15]],
1541
+ params: [127,127,127,127], typedParams: 1,
1542
+ returns: [127,127], typedReturns: 1,
1543
+ locals: [127], localNames: ["_this","_this#type","index","index#type","len"],
1544
+ };
1509
1545
  this.__String_prototype_startsWith = {
1510
1546
  wasm: (scope, {}) => [[32,0],[33,6],[32,2],[33,7],[32,0],[40,1,0],[33,8],[32,4],[65,0],[74],[4,64],[32,4],[32,8],[74],[4,64],[32,8],[33,4],[5],[32,4],[65,0],[114],[33,4],[11],[5],[65,0],[33,4],[11],[32,6],[32,4],[65,2],[108],[106],[33,6],[32,2],[40,1,0],[65,2],[108],[33,9],[65,0],[33,10],[3,64],[32,10],[32,9],[72],[4,64],[32,6],[32,10],[106],[47,0,4],[33,11],[32,7],[32,10],[106],[47,0,4],[33,12],[32,11],[32,12],[71],[4,64],[65,0],[65,1],[15],[11],[32,10],[65,2],[106],[34,10],[12,1],[11],[11],[65,1],[65,1],[15]],
1511
1547
  params: [127,127,127,127,127,127], typedParams: 1,
@@ -1688,6 +1724,18 @@ export const BuiltinFuncs = function() {
1688
1724
  returns: [127,127], typedReturns: 1,
1689
1725
  locals: [127,127,127,127], localNames: ["_this","_this#type","count","count#type","out","#last_type","thisLen","i"],
1690
1726
  };
1727
+ this.__String_prototype_split = {
1728
+ wasm: (scope, {builtin,internalThrow}) => [[16, builtin('__Porffor_allocate')],[33,7],[252,2],[33,6],[65,0],[33,8],[65,194,0],[33,9],[32,5],[65,3],[70],[4,64],[65,255,255,255,255,7],[34,4],[65,0],[33,5],[26],[11],[32,4],[65,0],[114],[34,4],[65,0],[33,5],[26],[32,4],[65,0],[72],[4,64],[65,255,255,255,255,7],[34,4],[65,0],[33,5],[26],[11],[16, builtin('__Porffor_allocate')],[33,7],[252,2],[33,10],[65,0],[33,11],[32,0],[40,1,0],[65,2],[108],[33,12],[32,2],[40,1,0],[34,13],[65,1],[70],[4,64],[32,2],[34,16],[40,1,0],[33,15],[32,3],[33,18],[2,127],[32,18],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[2,127],[65,0],[34,17],[32,15],[78],[4,64],[65,127],[12,1],[11],[32,17],[65,2],[108],[32,16],[106],[47,0,4],[65,0],[33,7],[11],[12,1],[11],[32,18],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[2,127],[65,0],[34,17],[32,15],[78],[4,64],[65,127],[12,1],[11],[32,17],[32,16],[106],[45,0,4],[65,0],[33,7],[11],[12,1],[11],...internalThrow(scope, 'TypeError', `'charCodeAt' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[33,14],[65,0],[33,19],[3,64],[32,19],[32,12],[72],[4,64],[2,64],[32,0],[32,19],[106],[47,0,4],[34,20],[32,14],[70],[4,64],[32,8],[32,4],[78],[4,64],[32,6],[32,8],[34,21],[54,1,0],[32,6],[65,208,0],[15],[11],[32,10],[32,11],[34,21],[54,1,0],[32,6],[32,8],[65,9],[108],[106],[32,10],[184],[57,0,4],[32,6],[32,8],[65,9],[108],[106],[32,9],[58,0,12],[32,8],[65,1],[106],[33,8],[16, builtin('__Porffor_allocate')],[33,7],[252,2],[33,10],[65,0],[33,11],[12,1],[11],[32,10],[32,11],[65,2],[108],[106],[32,20],[59,0,4],[32,11],[65,1],[106],[33,11],[11],[32,19],[65,2],[106],[34,19],[12,1],[11],[11],[5],[65,0],[33,22],[65,0],[33,19],[3,64],[32,19],[32,12],[72],[4,64],[2,64],[32,0],[32,19],[106],[47,0,4],[34,20],[32,2],[34,16],[40,1,0],[33,15],[32,3],[33,18],[2,127],[32,18],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[2,127],[32,22],[34,17],[32,15],[78],[4,64],[65,127],[12,1],[11],[32,17],[65,2],[108],[32,16],[106],[47,0,4],[65,0],[33,7],[11],[12,1],[11],[32,18],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[2,127],[32,22],[34,17],[32,15],[78],[4,64],[65,127],[12,1],[11],[32,17],[32,16],[106],[45,0,4],[65,0],[33,7],[11],[12,1],[11],...internalThrow(scope, 'TypeError', `'charCodeAt' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[70],[4,64],[32,22],[65,1],[106],[34,22],[32,13],[70],[4,64],[32,8],[32,4],[78],[4,64],[32,6],[32,8],[34,21],[54,1,0],[32,6],[65,208,0],[15],[11],[32,10],[32,11],[32,13],[65,1],[107],[107],[34,21],[54,1,0],[32,6],[32,8],[65,9],[108],[106],[32,10],[184],[57,0,4],[32,6],[32,8],[65,9],[108],[106],[32,9],[58,0,12],[32,8],[65,1],[106],[33,8],[16, builtin('__Porffor_allocate')],[33,7],[252,2],[33,10],[65,0],[33,11],[12,2],[11],[5],[65,0],[33,22],[11],[32,10],[32,11],[106],[32,20],[59,0,4],[32,11],[65,1],[106],[33,11],[11],[32,19],[65,2],[106],[34,19],[12,1],[11],[11],[11],[32,11],[65,0],[74],[34,23],[4,127],[32,8],[32,4],[72],[65,1],[33,7],[5],[32,23],[65,1],[33,7],[11],[33,24],[32,7],[33,18],[2,127],[32,18],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[32,24],[40,1,0],[12,1],[11],[32,18],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,24],[40,1,0],[12,1],[11],[32,24],[11,"TYPESWITCH_end"],[4,64],[32,10],[32,11],[34,21],[54,1,0],[32,6],[32,8],[65,9],[108],[106],[32,10],[184],[57,0,4],[32,6],[32,8],[65,9],[108],[106],[32,9],[58,0,12],[32,8],[65,1],[106],[33,8],[11],[32,6],[32,8],[34,21],[54,1,0],[32,6],[65,208,0],[15]],
1729
+ params: [127,127,127,127,127,127], typedParams: 1,
1730
+ returns: [127,127], typedReturns: 1,
1731
+ locals: [127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127], localNames: ["_this","_this#type","separator","separator#type","limit","limit#type","out","#last_type","outLen","sType","tmp","tmpLen","thisLen","sepLen","sepChar","__proto_length_cache","__proto_pointer_cache","__charCodeAt_tmp","#typeswitch_tmp","i","x","__length_setter_tmp","sepInd","logictmp","#logicinner_tmp"],
1732
+ };
1733
+ this.__ByteString_prototype_split = {
1734
+ wasm: (scope, {builtin,internalThrow}) => [[16, builtin('__Porffor_allocate')],[33,7],[252,2],[33,6],[65,0],[33,8],[65,194,1],[33,9],[32,5],[65,3],[70],[4,64],[65,255,255,255,255,7],[34,4],[65,0],[33,5],[26],[11],[32,4],[65,0],[114],[34,4],[65,0],[33,5],[26],[32,4],[65,0],[72],[4,64],[65,255,255,255,255,7],[34,4],[65,0],[33,5],[26],[11],[16, builtin('__Porffor_allocate')],[33,7],[252,2],[33,10],[65,0],[33,11],[32,0],[40,1,0],[33,12],[32,2],[40,1,0],[34,13],[65,1],[70],[4,64],[32,2],[34,16],[40,1,0],[33,15],[32,3],[33,18],[2,127],[32,18],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[2,127],[65,0],[34,17],[32,15],[78],[4,64],[65,127],[12,1],[11],[32,17],[65,2],[108],[32,16],[106],[47,0,4],[65,0],[33,7],[11],[12,1],[11],[32,18],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[2,127],[65,0],[34,17],[32,15],[78],[4,64],[65,127],[12,1],[11],[32,17],[32,16],[106],[45,0,4],[65,0],[33,7],[11],[12,1],[11],...internalThrow(scope, 'TypeError', `'charCodeAt' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[33,14],[65,0],[33,19],[3,64],[32,19],[32,12],[72],[4,64],[2,64],[32,0],[32,19],[106],[45,0,4],[34,20],[32,14],[70],[4,64],[32,8],[32,4],[78],[4,64],[32,6],[32,8],[34,21],[54,1,0],[32,6],[65,208,0],[15],[11],[32,10],[32,11],[34,21],[54,1,0],[32,6],[32,8],[65,9],[108],[106],[32,10],[184],[57,0,4],[32,6],[32,8],[65,9],[108],[106],[32,9],[58,0,12],[32,8],[65,1],[106],[33,8],[16, builtin('__Porffor_allocate')],[33,7],[252,2],[33,10],[65,0],[33,11],[12,1],[11],[32,10],[32,11],[106],[32,20],[58,0,4],[32,11],[65,1],[106],[33,11],[11],[32,19],[65,1],[106],[33,19],[12,1],[11],[11],[5],[65,0],[33,22],[65,0],[33,19],[3,64],[32,19],[32,12],[72],[4,64],[2,64],[32,0],[32,19],[106],[45,0,4],[34,20],[32,2],[34,16],[40,1,0],[33,15],[32,3],[33,18],[2,127],[32,18],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[2,127],[32,22],[34,17],[32,15],[78],[4,64],[65,127],[12,1],[11],[32,17],[65,2],[108],[32,16],[106],[47,0,4],[65,0],[33,7],[11],[12,1],[11],[32,18],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[2,127],[32,22],[34,17],[32,15],[78],[4,64],[65,127],[12,1],[11],[32,17],[32,16],[106],[45,0,4],[65,0],[33,7],[11],[12,1],[11],...internalThrow(scope, 'TypeError', `'charCodeAt' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[70],[4,64],[32,22],[65,1],[106],[34,22],[32,13],[70],[4,64],[32,8],[32,4],[78],[4,64],[32,6],[32,8],[34,21],[54,1,0],[32,6],[65,208,0],[15],[11],[32,10],[32,11],[32,13],[65,1],[107],[107],[34,21],[54,1,0],[32,6],[32,8],[65,9],[108],[106],[32,10],[184],[57,0,4],[32,6],[32,8],[65,9],[108],[106],[32,9],[58,0,12],[32,8],[65,1],[106],[33,8],[16, builtin('__Porffor_allocate')],[33,7],[252,2],[33,10],[65,0],[33,11],[12,2],[11],[5],[65,0],[33,22],[11],[32,10],[32,11],[106],[32,20],[58,0,4],[32,11],[65,1],[106],[33,11],[11],[32,19],[65,1],[106],[33,19],[12,1],[11],[11],[11],[32,11],[65,0],[74],[34,23],[4,127],[32,8],[32,4],[72],[65,1],[33,7],[5],[32,23],[65,1],[33,7],[11],[33,24],[32,7],[33,18],[2,127],[32,18],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[32,24],[40,1,0],[12,1],[11],[32,18],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,24],[40,1,0],[12,1],[11],[32,24],[11,"TYPESWITCH_end"],[4,64],[32,10],[32,11],[34,21],[54,1,0],[32,6],[32,8],[65,9],[108],[106],[32,10],[184],[57,0,4],[32,6],[32,8],[65,9],[108],[106],[32,9],[58,0,12],[32,8],[65,1],[106],[33,8],[11],[32,6],[32,8],[34,21],[54,1,0],[32,6],[65,208,0],[15]],
1735
+ params: [127,127,127,127,127,127], typedParams: 1,
1736
+ returns: [127,127], typedReturns: 1,
1737
+ locals: [127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127], localNames: ["_this","_this#type","separator","separator#type","limit","limit#type","out","#last_type","outLen","bsType","tmp","tmpLen","thisLen","sepLen","sepChar","__proto_length_cache","__proto_pointer_cache","__charCodeAt_tmp","#typeswitch_tmp","i","x","__length_setter_tmp","sepInd","logictmp","#logicinner_tmp"],
1738
+ };
1691
1739
  this.__String_prototype_toString = {
1692
1740
  wasm: (scope, {}) => [[32,0],[65,194,0],[15]],
1693
1741
  params: [127,127], typedParams: 1,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "porffor",
3
3
  "description": "a basic experimental wip aot optimizing js -> wasm engine/compiler/runtime in js",
4
- "version": "0.18.34+c83c8ab39",
4
+ "version": "0.18.36+ce8d0e379",
5
5
  "author": "CanadaHonk",
6
6
  "license": "MIT",
7
7
  "scripts": {},
package/runner/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import fs from 'node:fs';
3
- globalThis.version = '0.18.34+c83c8ab39';
3
+ globalThis.version = '0.18.36+ce8d0e379';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {