porffor 0.50.21 → 0.50.22

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.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/runner/index.js +15 -3
  3. package/ts.js +0 -198655
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.50.21",
4
+ "version": "0.50.22",
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.50.21';
3
+ globalThis.version = '0.50.22';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {
@@ -94,8 +94,6 @@ if (['precompile', 'run', 'wasm', 'native', 'c', 'flamegraph', 'hotlines', 'debu
94
94
  }
95
95
  }
96
96
 
97
- globalThis.file = file;
98
-
99
97
  let source = '', printOutput = false;
100
98
  if (process.argv.length >= 4) {
101
99
  let evalIndex = process.argv.indexOf('-e');
@@ -127,6 +125,20 @@ if (process.argv.length >= 4) {
127
125
  }
128
126
  }
129
127
 
128
+ if (file.startsWith('https://')) { // https only :)
129
+ // rce warning, make user confirm (disabled)
130
+ // const rl = (await import('readline')).createInterface({ input: process.stdin, output: process.stdout });
131
+ // const ans = await new Promise(resolve => rl.question(`\u001b[1mAre you sure you want to download this URL:\u001b[0m ${file} (y/n)? `, ans => {
132
+ // rl.close();
133
+ // resolve(ans);
134
+ // }));
135
+ // if (ans.toLowerCase()[0] !== 'y') process.exit();
136
+
137
+ source = await (await fetch(file)).text();
138
+ }
139
+
140
+ globalThis.file = file;
141
+
130
142
  if (!file && !source) {
131
143
  if (process.argv.includes('-v') || process.argv.includes('--version')) {
132
144
  // just print version