@constela/compiler 0.15.4 → 0.15.6
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/dist/index.d.ts +1 -1
- package/dist/index.js +48 -5
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -243,7 +243,9 @@ function validateExpression(expr, path, context, scope, paramScope) {
|
|
|
243
243
|
break;
|
|
244
244
|
case "call": {
|
|
245
245
|
const callExpr = expr;
|
|
246
|
-
|
|
246
|
+
if (callExpr.target !== null) {
|
|
247
|
+
errors.push(...validateExpression(callExpr.target, buildPath(path, "target"), context, scope, paramScope));
|
|
248
|
+
}
|
|
247
249
|
if (callExpr.args) {
|
|
248
250
|
for (let i = 0; i < callExpr.args.length; i++) {
|
|
249
251
|
const arg = callExpr.args[i];
|
|
@@ -274,6 +276,16 @@ function validateExpression(expr, path, context, scope, paramScope) {
|
|
|
274
276
|
}
|
|
275
277
|
break;
|
|
276
278
|
}
|
|
279
|
+
case "concat": {
|
|
280
|
+
const concatExpr = expr;
|
|
281
|
+
for (let i = 0; i < concatExpr.items.length; i++) {
|
|
282
|
+
const item = concatExpr.items[i];
|
|
283
|
+
if (item) {
|
|
284
|
+
errors.push(...validateExpression(item, buildPath(path, "items", i), context, scope, paramScope));
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
277
289
|
}
|
|
278
290
|
return errors;
|
|
279
291
|
}
|
|
@@ -616,7 +628,9 @@ function validateExpressionStateOnly(expr, path, context) {
|
|
|
616
628
|
break;
|
|
617
629
|
case "call": {
|
|
618
630
|
const callExpr = expr;
|
|
619
|
-
|
|
631
|
+
if (callExpr.target !== null) {
|
|
632
|
+
errors.push(...validateExpressionStateOnly(callExpr.target, buildPath(path, "target"), context));
|
|
633
|
+
}
|
|
620
634
|
if (callExpr.args) {
|
|
621
635
|
for (let i = 0; i < callExpr.args.length; i++) {
|
|
622
636
|
const arg = callExpr.args[i];
|
|
@@ -642,6 +656,16 @@ function validateExpressionStateOnly(expr, path, context) {
|
|
|
642
656
|
}
|
|
643
657
|
break;
|
|
644
658
|
}
|
|
659
|
+
case "concat": {
|
|
660
|
+
const concatExpr = expr;
|
|
661
|
+
for (let i = 0; i < concatExpr.items.length; i++) {
|
|
662
|
+
const item = concatExpr.items[i];
|
|
663
|
+
if (item) {
|
|
664
|
+
errors.push(...validateExpressionStateOnly(item, buildPath(path, "items", i), context));
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
break;
|
|
668
|
+
}
|
|
645
669
|
}
|
|
646
670
|
return errors;
|
|
647
671
|
}
|
|
@@ -757,7 +781,9 @@ function validateExpressionInEventPayload(expr, path, context, scope) {
|
|
|
757
781
|
break;
|
|
758
782
|
case "call": {
|
|
759
783
|
const callExpr = expr;
|
|
760
|
-
|
|
784
|
+
if (callExpr.target !== null) {
|
|
785
|
+
errors.push(...validateExpressionInEventPayload(callExpr.target, buildPath(path, "target"), context, scope));
|
|
786
|
+
}
|
|
761
787
|
if (callExpr.args) {
|
|
762
788
|
for (let i = 0; i < callExpr.args.length; i++) {
|
|
763
789
|
const arg = callExpr.args[i];
|
|
@@ -788,6 +814,16 @@ function validateExpressionInEventPayload(expr, path, context, scope) {
|
|
|
788
814
|
}
|
|
789
815
|
break;
|
|
790
816
|
}
|
|
817
|
+
case "concat": {
|
|
818
|
+
const concatExpr = expr;
|
|
819
|
+
for (let i = 0; i < concatExpr.items.length; i++) {
|
|
820
|
+
const item = concatExpr.items[i];
|
|
821
|
+
if (item) {
|
|
822
|
+
errors.push(...validateExpressionInEventPayload(item, buildPath(path, "items", i), context, scope));
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
break;
|
|
826
|
+
}
|
|
791
827
|
}
|
|
792
828
|
return errors;
|
|
793
829
|
}
|
|
@@ -1433,7 +1469,7 @@ function transformExpression(expr, ctx) {
|
|
|
1433
1469
|
const callExpr = expr;
|
|
1434
1470
|
const result = {
|
|
1435
1471
|
expr: "call",
|
|
1436
|
-
target: transformExpression(callExpr.target, ctx),
|
|
1472
|
+
target: callExpr.target === null ? null : transformExpression(callExpr.target, ctx),
|
|
1437
1473
|
method: callExpr.method
|
|
1438
1474
|
};
|
|
1439
1475
|
if (callExpr.args && callExpr.args.length > 0) {
|
|
@@ -2515,7 +2551,7 @@ function transformExpression2(expr, ctx) {
|
|
|
2515
2551
|
const callExpr = expr;
|
|
2516
2552
|
const result = {
|
|
2517
2553
|
expr: "call",
|
|
2518
|
-
target: transformExpression2(callExpr.target, ctx),
|
|
2554
|
+
target: callExpr.target === null ? null : transformExpression2(callExpr.target, ctx),
|
|
2519
2555
|
method: callExpr.method
|
|
2520
2556
|
};
|
|
2521
2557
|
if (callExpr.args && callExpr.args.length > 0) {
|
|
@@ -2542,6 +2578,13 @@ function transformExpression2(expr, ctx) {
|
|
|
2542
2578
|
elements: arrayExpr.elements.map((elem) => transformExpression2(elem, ctx))
|
|
2543
2579
|
};
|
|
2544
2580
|
}
|
|
2581
|
+
case "concat": {
|
|
2582
|
+
const concatExpr = expr;
|
|
2583
|
+
return {
|
|
2584
|
+
expr: "concat",
|
|
2585
|
+
items: concatExpr.items.map((item) => transformExpression2(item, ctx))
|
|
2586
|
+
};
|
|
2587
|
+
}
|
|
2545
2588
|
default:
|
|
2546
2589
|
return { expr: "lit", value: null };
|
|
2547
2590
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constela/compiler",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.6",
|
|
4
4
|
"description": "Compiler for Constela UI framework - AST to Program transformation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@constela/core": "0.
|
|
18
|
+
"@constela/core": "0.18.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^20.10.0",
|