fez-lisp 1.1.32 → 1.1.33
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/interpreter.js +12 -2
package/package.json
CHANGED
package/src/interpreter.js
CHANGED
@@ -497,7 +497,12 @@ const keywords = {
|
|
497
497
|
if (circuit) continue
|
498
498
|
else return 0
|
499
499
|
}
|
500
|
-
|
500
|
+
const end = evaluate(args.at(-1), env)
|
501
|
+
if (end !== FALSE && end !== TRUE)
|
502
|
+
throw new TypeError(
|
503
|
+
`Condition of (${KEYWORDS.AND}) must be 0 or 1 but got ${end}`
|
504
|
+
)
|
505
|
+
return end
|
501
506
|
},
|
502
507
|
[KEYWORDS.OR]: (args, env) => {
|
503
508
|
if (args.length < 2)
|
@@ -516,7 +521,12 @@ const keywords = {
|
|
516
521
|
if (circuit) return 1
|
517
522
|
else continue
|
518
523
|
}
|
519
|
-
|
524
|
+
const end = evaluate(args.at(-1), env)
|
525
|
+
if (end !== FALSE && end !== TRUE)
|
526
|
+
throw new TypeError(
|
527
|
+
`Condition of (${KEYWORDS.OR}) must be 0 or 1 but got ${end}`
|
528
|
+
)
|
529
|
+
return end
|
520
530
|
},
|
521
531
|
[KEYWORDS.CALL_FUNCTION]: (args, env) => {
|
522
532
|
if (!args.length)
|