porffor 0.37.25 → 0.37.26
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/builtins/object.ts +18 -0
- package/compiler/builtins_precompiled.js +51 -50
- package/compiler/codegen.js +6 -2
- package/nova.comp.cjs +3 -0
- package/package.json +1 -1
- package/runner/index.js +1 -1
package/compiler/codegen.js
CHANGED
@@ -1174,6 +1174,10 @@ const getType = (scope, _name) => {
|
|
1174
1174
|
return number(TYPES.undefined, Valtype.i32);
|
1175
1175
|
}
|
1176
1176
|
|
1177
|
+
if (name === 'arguments' && scope.name !== 'main' && !scope.arrow) {
|
1178
|
+
return number(TYPES.array, Valtype.i32);
|
1179
|
+
}
|
1180
|
+
|
1177
1181
|
if (Object.hasOwn(globals, name)) {
|
1178
1182
|
if (globals[name]?.metadata?.type != null) return number(globals[name].metadata.type, Valtype.i32);
|
1179
1183
|
|
@@ -3624,7 +3628,7 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
|
|
3624
3628
|
// default: internalThrow(scope, 'TypeError', `Cannot assign member with this type`)
|
3625
3629
|
default: () => [
|
3626
3630
|
...objectWasm,
|
3627
|
-
Opcodes.
|
3631
|
+
Opcodes.i32_to,
|
3628
3632
|
...(op === '=' ? [] : [ [ Opcodes.local_tee, localTmp(scope, '#objset_object', Valtype.i32) ] ]),
|
3629
3633
|
...getNodeType(scope, object),
|
3630
3634
|
|
@@ -5636,7 +5640,7 @@ const generateMember = (scope, decl, _global, _name, _objectWasm = undefined) =>
|
|
5636
5640
|
// default: internalThrow(scope, 'TypeError', 'Unsupported member expression object', true)
|
5637
5641
|
default: () => [
|
5638
5642
|
...objectWasm,
|
5639
|
-
Opcodes.
|
5643
|
+
Opcodes.i32_to,
|
5640
5644
|
...getNodeType(scope, object),
|
5641
5645
|
|
5642
5646
|
...toPropertyKey(scope, propertyWasm, getNodeType(scope, property), decl.computed, true),
|
package/nova.comp.cjs
ADDED
@@ -0,0 +1,3 @@
|
|
1
|
+
const uniq = [...new Set(require('../nova.json').pass.map(x => x.slice(5))).difference(new Set(require('./test262/results.json').passes))];
|
2
|
+
console.log([...uniq.reduce((acc, x) => { let k = x.split('/').slice(0, -1).join('/'); return acc.set(k, (acc.get(k) || 0) + 1); }, new Map()).entries()].sort((a, b) => a[1] - b[1]).slice(-20).map(x => x[0] + ': ' + x[1]).join('\n'));
|
3
|
+
console.log(uniq.filter(x => x.startsWith('built-ins/Object/defineProperty')).join('\n'))
|
package/package.json
CHANGED