porffor 0.34.1 → 0.34.2
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.
- package/compiler/index.js +2 -6
- package/compiler/parse.js +1 -1
- package/package.json +1 -1
- package/runner/index.js +1 -1
- package/runner/repl.js +1 -4
package/compiler/index.js
CHANGED
@@ -33,14 +33,10 @@ export default (code, flags) => {
|
|
33
33
|
|
34
34
|
let outFile = Prefs.o;
|
35
35
|
|
36
|
-
globalThis.valtype = 'f64';
|
37
|
-
const valtypeOpt = process.argv.find(x => x.startsWith('--valtype='));
|
38
|
-
if (valtypeOpt) valtype = valtypeOpt.split('=')[1];
|
36
|
+
globalThis.valtype = Prefs.valtype ?? 'f64';
|
39
37
|
globalThis.valtypeBinary = Valtype[valtype];
|
40
38
|
|
41
|
-
globalThis.pageSize = PageSize;
|
42
|
-
const pageSizeOpt = process.argv.find(x => x.startsWith('--page-size='));
|
43
|
-
if (pageSizeOpt) pageSize = parseInt(pageSizeOpt.split('=')[1]) * 1024;
|
39
|
+
globalThis.pageSize = (parseInt(Prefs.valtype) * 1024) || PageSize;
|
44
40
|
|
45
41
|
// change some prefs by default for c/native
|
46
42
|
if (target !== 'wasm') {
|
package/compiler/parse.js
CHANGED
@@ -17,7 +17,7 @@ globalThis.typedInput = types && Prefs.optTypes;
|
|
17
17
|
globalThis.parser = '';
|
18
18
|
let parse;
|
19
19
|
const loadParser = async (fallbackParser = 'acorn', forceParser) => {
|
20
|
-
parser = forceParser ??
|
20
|
+
parser = forceParser ?? Prefs.parser ?? fallbackParser;
|
21
21
|
0, { parse } = (await import((globalThis.document || globalThis.Deno ? 'https://esm.sh/' : '') + parser));
|
22
22
|
};
|
23
23
|
globalThis._porf_loadParser = loadParser;
|
package/package.json
CHANGED
package/runner/index.js
CHANGED
package/runner/repl.js
CHANGED
@@ -18,10 +18,7 @@ try {
|
|
18
18
|
repl = (await import('node-repl-polyfill')).default;
|
19
19
|
}
|
20
20
|
|
21
|
-
globalThis.valtype = 'f64';
|
22
|
-
|
23
|
-
const valtypeOpt = process.argv.find(x => x.startsWith('--valtype='));
|
24
|
-
if (valtypeOpt) valtype = valtypeOpt.split('=')[1];
|
21
|
+
globalThis.valtype = Prefs.valtype ?? 'f64';
|
25
22
|
|
26
23
|
let host = globalThis?.navigator?.userAgent;
|
27
24
|
if (typeof process !== 'undefined' && process.argv0 === 'node') host = 'Node/' + process.versions.node;
|