eyeling 1.12.0 → 1.12.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.
- package/eyeling.js +4 -2
- package/lib/builtins.js +4 -2
- package/package.json +1 -1
package/eyeling.js
CHANGED
|
@@ -1418,7 +1418,8 @@ function evalBuiltin(goal, subst, facts, backRules, depth, varGen, maxResults) {
|
|
|
1418
1418
|
// math:sum
|
|
1419
1419
|
// Schema: ( $s.i+ )+ math:sum $o-
|
|
1420
1420
|
if (pv === MATH_NS + 'sum') {
|
|
1421
|
-
|
|
1421
|
+
// We accept any (possibly empty) closed list here.
|
|
1422
|
+
if (!(g.s instanceof ListTerm)) return [];
|
|
1422
1423
|
const xs = g.s.elems;
|
|
1423
1424
|
|
|
1424
1425
|
const dtOut0 = commonNumericDatatype(xs, g.o);
|
|
@@ -1472,7 +1473,8 @@ function evalBuiltin(goal, subst, facts, backRules, depth, varGen, maxResults) {
|
|
|
1472
1473
|
// math:product
|
|
1473
1474
|
// Schema: ( $s.i+ )+ math:product $o-
|
|
1474
1475
|
if (pv === MATH_NS + 'product') {
|
|
1475
|
-
|
|
1476
|
+
// We accept any (possibly empty) closed list here.
|
|
1477
|
+
if (!(g.s instanceof ListTerm)) return [];
|
|
1476
1478
|
const xs = g.s.elems;
|
|
1477
1479
|
|
|
1478
1480
|
const dtOut0 = commonNumericDatatype(xs, g.o);
|
package/lib/builtins.js
CHANGED
|
@@ -1406,7 +1406,8 @@ function evalBuiltin(goal, subst, facts, backRules, depth, varGen, maxResults) {
|
|
|
1406
1406
|
// math:sum
|
|
1407
1407
|
// Schema: ( $s.i+ )+ math:sum $o-
|
|
1408
1408
|
if (pv === MATH_NS + 'sum') {
|
|
1409
|
-
|
|
1409
|
+
// We accept any (possibly empty) closed list here.
|
|
1410
|
+
if (!(g.s instanceof ListTerm)) return [];
|
|
1410
1411
|
const xs = g.s.elems;
|
|
1411
1412
|
|
|
1412
1413
|
const dtOut0 = commonNumericDatatype(xs, g.o);
|
|
@@ -1460,7 +1461,8 @@ function evalBuiltin(goal, subst, facts, backRules, depth, varGen, maxResults) {
|
|
|
1460
1461
|
// math:product
|
|
1461
1462
|
// Schema: ( $s.i+ )+ math:product $o-
|
|
1462
1463
|
if (pv === MATH_NS + 'product') {
|
|
1463
|
-
|
|
1464
|
+
// We accept any (possibly empty) closed list here.
|
|
1465
|
+
if (!(g.s instanceof ListTerm)) return [];
|
|
1464
1466
|
const xs = g.s.elems;
|
|
1465
1467
|
|
|
1466
1468
|
const dtOut0 = commonNumericDatatype(xs, g.o);
|