porffor 0.55.3 → 0.55.5
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/.fails.cjs +8 -2
- package/compiler/codegen.js +2 -3
- package/compiler/wrap.js +3 -3
- package/package.json +1 -1
- package/r.js +2 -0
- package/runner/index.js +1 -1
package/.fails.cjs
CHANGED
@@ -1,14 +1,20 @@
|
|
1
1
|
const all = require('./all.json').map(x => x.slice(21));
|
2
2
|
const { passes } = require('./test262/results.json');
|
3
3
|
const fails = all.filter(x => !passes.includes(x));
|
4
|
+
{
|
5
|
+
const dirs = Object.groupBy(fails, x => x.split('/').slice(0, 2).join('/'));
|
6
|
+
const top = Object.keys(dirs).sort((a, b) => dirs[b].length - dirs[a].length);
|
7
|
+
console.log(top.slice(0, 20).map(x => `${x}: ${dirs[x].length} (${((dirs[x].length / all.length) * 100).toFixed(2)}%)`).join('\n'));
|
8
|
+
}
|
9
|
+
console.log()
|
4
10
|
{
|
5
11
|
const dirs = Object.groupBy(fails, x => x.split('/').slice(0, 3).join('/'));
|
6
12
|
const top = Object.keys(dirs).sort((a, b) => dirs[b].length - dirs[a].length);
|
7
|
-
console.log(top.slice(0,
|
13
|
+
console.log(top.slice(0, 20).map(x => `${x}: ${dirs[x].length} (${((dirs[x].length / all.length) * 100).toFixed(2)}%)`).join('\n'));
|
8
14
|
}
|
9
15
|
console.log()
|
10
16
|
{
|
11
17
|
const dirs = Object.groupBy(fails, x => x.split('/').slice(0, 4).join('/'));
|
12
18
|
const top = Object.keys(dirs).sort((a, b) => dirs[b].length - dirs[a].length);
|
13
|
-
console.log(top.slice(0,
|
19
|
+
console.log(top.slice(0, 20).map(x => `${x}: ${dirs[x].length} (${((dirs[x].length / all.length) * 100).toFixed(2)}%)`).join('\n'));
|
14
20
|
}
|
package/compiler/codegen.js
CHANGED
@@ -474,9 +474,8 @@ const lookup = (scope, name, failEarly = false) => {
|
|
474
474
|
|
475
475
|
// no local var with name
|
476
476
|
if (Object.hasOwn(globals, name)) return [ [ Opcodes.global_get, globals[name].idx ] ];
|
477
|
-
|
478
|
-
if (Object.hasOwn(importedFuncs, name)) return [ number(importedFuncs[name] - importedFuncs.length) ];
|
479
477
|
if (Object.hasOwn(funcIndex, name)) return funcRef(funcByName(name));
|
478
|
+
if (Object.hasOwn(importedFuncs, name)) return [ number(importedFuncs[name] - importedFuncs.length) ];
|
480
479
|
|
481
480
|
if (name.startsWith('__')) {
|
482
481
|
// return undefined if unknown key in already known var
|
@@ -2705,7 +2704,7 @@ const generateCall = (scope, decl, _global, _name, unusedValue = false) => {
|
|
2705
2704
|
}
|
2706
2705
|
|
2707
2706
|
if ((builtinFuncs[name] && builtinFuncs[name].returns?.length === 0) ||
|
2708
|
-
(importedFuncs[name]
|
2707
|
+
(idx === importedFuncs[name] && importedFuncs[importedFuncs[name]]?.returns === 0)) {
|
2709
2708
|
out.push(number(UNDEFINED));
|
2710
2709
|
}
|
2711
2710
|
|
package/compiler/wrap.js
CHANGED
@@ -366,10 +366,10 @@ export default (source, module = undefined, customImports = {}, print = str => p
|
|
366
366
|
const disasm = disassemble(func.wasm.slice(min, max), func.name, 0, func.locals, func.params, func.returns, funcs, globals, exceptions)
|
367
367
|
.slice(0, -1).split('\n').filter(x => !x.startsWith('\x1B[90m;;'));
|
368
368
|
|
369
|
-
const noAnsi = s => s.replace(/\u001b\[[0-9]+m/g, '');
|
369
|
+
const noAnsi = s => s && s.replace(/\u001b\[[0-9]+m/g, '');
|
370
370
|
let longest = 0;
|
371
371
|
for (let j = 0; j < disassemble.length; j++) {
|
372
|
-
longest = Math.max(longest, noAnsi(disassemble[j])
|
372
|
+
longest = Math.max(longest, noAnsi(disassemble[j])?.length ?? 0);
|
373
373
|
}
|
374
374
|
|
375
375
|
if (middleIndex != -1) {
|
@@ -537,7 +537,7 @@ export default (source, module = undefined, customImports = {}, print = str => p
|
|
537
537
|
}
|
538
538
|
|
539
539
|
if (Prefs.disassemble) {
|
540
|
-
return { exports, wasm, times,
|
540
|
+
return { exports, wasm, times, disasms: funcs.map(x => disassemble(x.wasm, x.name, x.index, x.locals, x.params, x.returns, funcs, globals, exceptions)), c };
|
541
541
|
}
|
542
542
|
|
543
543
|
return { exports, wasm, times, pages, c };
|
package/package.json
CHANGED
package/r.js
ADDED