porffor 0.18.6 → 0.18.8

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.
@@ -5,7 +5,7 @@ export const __String_prototype_trimLeft = (_this: string) => {
5
5
  return __String_prototype_trimStart(_this);
6
6
  };
7
7
 
8
- export const __ByteString_prototype_trimLeft = (_this: string) => {
8
+ export const __ByteString_prototype_trimLeft = (_this: bytestring) => {
9
9
  return __ByteString_prototype_trimStart(_this);
10
10
  };
11
11
 
@@ -14,6 +14,6 @@ export const __String_prototype_trimRight = (_this: string) => {
14
14
  return __String_prototype_trimEnd(_this);
15
15
  };
16
16
 
17
- export const __ByteString_prototype_trimRight = (_this: string) => {
17
+ export const __ByteString_prototype_trimRight = (_this: bytestring) => {
18
18
  return __ByteString_prototype_trimEnd(_this);
19
19
  };
@@ -46,8 +46,6 @@ export const __Array_prototype_slice = (_this: any[], start: number, end: number
46
46
  return out;
47
47
  };
48
48
 
49
- // todo: splice
50
-
51
49
  // @porf-typed-array
52
50
  export const __Array_prototype_fill = (_this: any[], value: any, start: any, end: any) => {
53
51
  const len: i32 = _this.length;
@@ -199,14 +199,8 @@ const generate = (scope, decl, global = false, name = undefined, valueUnused = f
199
199
  return out;
200
200
  },
201
201
 
202
- __Porffor_bs: str => [
203
- ...makeString(scope, str, global, name, true),
204
- ...(name ? setType(scope, name, TYPES.bytestring) : setLastType(scope, TYPES.bytestring))
205
- ],
206
- __Porffor_s: str => [
207
- ...makeString(scope, str, global, name, false),
208
- ...(name ? setType(scope, name, TYPES.string) : setLastType(scope, TYPES.string))
209
- ],
202
+ __Porffor_bs: str => makeString(scope, str, global, name, true),
203
+ __Porffor_s: str => makeString(scope, str, global, name, false)
210
204
  };
211
205
 
212
206
  const func = decl.tag.name;
@@ -1383,7 +1377,11 @@ const getNodeType = (scope, node) => {
1383
1377
 
1384
1378
  if (node.type === 'TaggedTemplateExpression') {
1385
1379
  // hack
1386
- if (node.tag.name.startsWith('__Porffor_')) return TYPES.number;
1380
+ switch (node.tag.name) {
1381
+ case '__Porffor_wasm': return TYPES.number;
1382
+ case '__Porffor_bs': return TYPES.bytestring;
1383
+ case '__Porffor_s': return TYPES.string;
1384
+ }
1387
1385
  }
1388
1386
 
1389
1387
  if (scope.locals['#last_type']) return getLastType(scope);
@@ -192,7 +192,7 @@ export const BuiltinFuncs = function() {
192
192
  localNames: ["_this","_this#type","#last_type"],
193
193
  };
194
194
  this.__ByteString_prototype_trimLeft = {
195
- wasm: (scope, {builtin,}) => [[32,0],[65,194,0],[16, builtin('__ByteString_prototype_trimStart')],[34,2],[15]],
195
+ wasm: (scope, {builtin,}) => [[32,0],[65,210,0],[16, builtin('__ByteString_prototype_trimStart')],[34,2],[15]],
196
196
  params: [127,127],
197
197
  typedParams: true,
198
198
  returns: [127,127],
@@ -210,7 +210,7 @@ export const BuiltinFuncs = function() {
210
210
  localNames: ["_this","_this#type","#last_type"],
211
211
  };
212
212
  this.__ByteString_prototype_trimRight = {
213
- wasm: (scope, {builtin,}) => [[32,0],[65,194,0],[16, builtin('__ByteString_prototype_trimEnd')],[34,2],[15]],
213
+ wasm: (scope, {builtin,}) => [[32,0],[65,210,0],[16, builtin('__ByteString_prototype_trimEnd')],[34,2],[15]],
214
214
  params: [127,127],
215
215
  typedParams: true,
216
216
  returns: [127,127],
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.6+dc00fb656",
4
+ "version": "0.18.8+024a81666",
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.6+dc00fb656';
3
+ globalThis.version = '0.18.8+024a81666';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {