porffor 0.2.0-a88bbe6 → 0.2.0-a910bd0

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.
@@ -1,4 +1,4 @@
1
- // @porf --valtype=i32
1
+ // @porf --funsafe-no-unlikely-proto-checks --valtype=i32
2
2
 
3
3
  export const __String_prototype_trimLeft = (_this: string) => {
4
4
  return __String_prototype_trimStart(_this);
@@ -1,3 +1,5 @@
1
+ // @porf --funsafe-no-unlikely-proto-checks
2
+
1
3
  export const __Array_isArray = (x: unknown): boolean =>
2
4
  // Porffor.wasm`local.get ${x+1}` == Porffor.TYPES.array;
3
5
  Porffor.rawType(x) == Porffor.TYPES.array;
@@ -1,4 +1,4 @@
1
- // @porf --valtype=i32
1
+ // @porf --funsafe-no-unlikely-proto-checks --valtype=i32
2
2
 
3
3
  export const btoa = (input: bytestring): bytestring => {
4
4
  const keyStr: bytestring = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -1,3 +1,5 @@
1
+ // @porf --funsafe-no-unlikely-proto-checks
2
+
1
3
  // 20.3.3.2 Boolean.prototype.toString ()
2
4
  // https://tc39.es/ecma262/#sec-boolean.prototype.tostring
3
5
  export const __Boolean_prototype_toString = (_this: boolean) => {
@@ -1,4 +1,4 @@
1
- // @porf --valtype=i32
1
+ // @porf --funsafe-no-unlikely-proto-checks --valtype=i32
2
2
 
3
3
  export const __crypto_randomUUID = (): bytestring => {
4
4
  let bytes: bytestring = '................';
@@ -1,3 +1,5 @@
1
+ // @porf --funsafe-no-unlikely-proto-checks
2
+
1
3
  // 21.4.1.3 Day (t)
2
4
  // https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-day
3
5
  // 1. Return 𝔽(floor(ℝ(t / msPerDay))).
@@ -1,4 +1,4 @@
1
- // @porf --valtype=i32
1
+ // @porf --funsafe-no-unlikely-proto-checks --valtype=i32
2
2
 
3
3
  import type {} from './porffor';
4
4
 
@@ -1,3 +1,5 @@
1
+ // // @porf --funsafe-no-unlikely-proto-checks
2
+
1
3
  export const __Function_prototype_toString = (_this: Function) => {
2
4
  // todo: actually use source
3
5
  let out: bytestring = 'function () {}';
@@ -1,3 +1,5 @@
1
+ // @porf --funsafe-no-unlikely-proto-checks
2
+
1
3
  // radix: number|any for rawType check
2
4
  // export const parseInt = (input: string|bytestring, radix: number|any): f64 => {
3
5
  export const parseInt = (input: string|bytestring, radix: number): f64 => {
@@ -1,3 +1,5 @@
1
+ // @porf --funsafe-no-unlikely-proto-checks
2
+
1
3
  // radix: number|any for rawType check
2
4
  export const __Number_prototype_toString = (_this: number, radix: number|any) => {
3
5
  let out: bytestring = '';
@@ -1,3 +1,5 @@
1
+ // // @porf --funsafe-no-unlikely-proto-checks
2
+
1
3
  export const __Object_prototype_toString = (_this: object) => {
2
4
  let out: bytestring = '[object Object]';
3
5
  return out;
@@ -1,3 +1,5 @@
1
+ // @porf --funsafe-no-unlikely-proto-checks
2
+
1
3
  // dark wasm magic for dealing with memory, sorry.
2
4
  export const __Porffor_allocate = (): number => {
3
5
  Porffor.wasm`i32.const 1
@@ -1,4 +1,4 @@
1
- // @porf --valtype=i32
1
+ // @porf --funsafe-no-unlikely-proto-checks --valtype=i32
2
2
 
3
3
  export const __String_fromCharCode = (code: i32) => {
4
4
  // todo: support >1 arg
@@ -18,7 +18,7 @@ const compile = async (file, [ _funcs, _globals ]) => {
18
18
  first = source.slice(0, source.indexOf('\n'));
19
19
  }
20
20
 
21
- let args = ['--bytestring', '--todo-time=compile', '--no-aot-pointer-opt', '--no-treeshake-wasm-imports', '--no-rm-unused-types', '--scoped-page-names', '--funsafe-no-unlikely-proto-checks', '--parse-types', '--opt-types'];
21
+ let args = ['--bytestring', '--todo-time=compile', '--no-aot-pointer-opt', '--no-treeshake-wasm-imports', '--no-rm-unused-types', '--scoped-page-names', '--parse-types', '--opt-types'];
22
22
  if (first.startsWith('// @porf')) {
23
23
  args = args.concat(first.slice('// @porf '.length).split(' '));
24
24
  }
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.2.0-a88bbe6",
4
+ "version": "0.2.0-a910bd0",
5
5
  "author": "CanadaHonk",
6
6
  "license": "MIT",
7
7
  "scripts": {