@graffiticode/parser 1.3.0 → 1.3.1

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 (2) hide show
  1. package/package.json +2 -2
  2. package/src/folder.js +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graffiticode/parser",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -22,6 +22,6 @@
22
22
  "license": "MIT",
23
23
  "description": "",
24
24
  "dependencies": {
25
- "@graffiticode/basis": "^1.6.3"
25
+ "@graffiticode/basis": "^1.6.4"
26
26
  }
27
27
  }
package/src/folder.js CHANGED
@@ -202,12 +202,13 @@ export class Folder {
202
202
  }
203
203
  } else if (word.cls === "function") {
204
204
  const elts = [];
205
- for (let i = 0; i < word.length; i++) {
205
+ const argc = word.arity !== undefined ? word.arity : word.length;
206
+ for (let i = 0; i < argc; i++) {
206
207
  const elt = Ast.pop(ctx);
207
208
  assertErr(
208
209
  ctx,
209
210
  elt,
210
- `Too few arguments for ${word.name}. Expected ${word.length}.`,
211
+ `Too few arguments for ${word.name}. Expected ${argc}.`,
211
212
  node.coord
212
213
  );
213
214
  elts.push(elt);