fez-lisp 1.6.1 → 1.6.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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "fez-lisp",
3
3
  "description": "Lisp interpreted & compiled to JavaScript",
4
4
  "author": "AT290690",
5
- "version": "1.6.1",
5
+ "version": "1.6.2",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
package/src/check.js CHANGED
@@ -521,8 +521,9 @@ const IfApplyBranch = ({
521
521
  break
522
522
  case KEYWORDS.CALL_FUNCTION:
523
523
  if (re.at(-1)[TYPE] === WORD) {
524
- if (env[re.at(-1)[VALUE]] && re.at(-1)[VALUE] !== ref[STATS][SIGNATURE])
525
- setPropToReturnRef(ref[STATS], prop, env[re.at(-1)[VALUE]][STATS])
524
+ const name = re.at(-1)[VALUE]
525
+ if (env[name] && re.at(-1)[VALUE] !== ref[STATS][SIGNATURE])
526
+ setPropToReturnRef(ref[STATS], prop, env[name][STATS])
526
527
  } else {
527
528
  const returns = returnType(re.at(-1))
528
529
  if (env[returns[VALUE]] && returns[VALUE] !== ref[STATS][SIGNATURE])
@@ -1816,8 +1817,9 @@ export const typeCheck = (ast, ctx = SPECIAL_FORM_TYPES) => {
1816
1817
  stagger(stack, 'prepend', [first, env], judge)
1817
1818
  for (let i = 0; i < rest.length; ++i) {
1818
1819
  const r = rest[i]
1819
- if (isLeaf(r) && r[TYPE] !== ATOM)
1820
- if (env[r[VALUE]] == undefined)
1820
+ if (isLeaf(r) && r[TYPE] !== ATOM) {
1821
+ const name = r[VALUE]
1822
+ if (env[name] == undefined)
1821
1823
  throw new TypeError(
1822
1824
  `(${
1823
1825
  first[VALUE]
@@ -1825,6 +1827,7 @@ export const typeCheck = (ast, ctx = SPECIAL_FORM_TYPES) => {
1825
1827
  r[VALUE]
1826
1828
  }) at argument (${i}) (${stringifyArgs(exp)}) (check #20)`
1827
1829
  )
1830
+ }
1828
1831
  check(r, env, scope)
1829
1832
  }
1830
1833
  break