porffor 0.42.7 → 0.42.8
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/codegen.js +12 -2
- package/package.json +1 -1
- package/runner/index.js +1 -1
- package/r.js +0 -4
package/compiler/codegen.js
CHANGED
@@ -399,9 +399,19 @@ const generateIdent = (scope, decl) => {
|
|
399
399
|
|
400
400
|
if (local?.idx === undefined) {
|
401
401
|
if (name === 'arguments' && scope.name !== 'main' && !scope.arrow) {
|
402
|
-
// todo:
|
402
|
+
// todo: not compliant
|
403
|
+
let len = countLength(scope);
|
404
|
+
const names = new Array(len);
|
405
|
+
const off = scope.constr ? 4 : 0;
|
406
|
+
for (const x in scope.locals) {
|
407
|
+
const i = scope.locals[x].idx - off;
|
408
|
+
if (i >= 0 && i % 2 === 0 && i < len * 2) {
|
409
|
+
names[i / 2] = x;
|
410
|
+
}
|
411
|
+
}
|
412
|
+
|
403
413
|
return generateArray(scope, {
|
404
|
-
elements:
|
414
|
+
elements: names.map(x => ({ type: 'Identifier', name: x }))
|
405
415
|
}, false, '#arguments');
|
406
416
|
}
|
407
417
|
|
package/package.json
CHANGED
package/runner/index.js
CHANGED
package/r.js
DELETED