@katabatic/compiler 1.1.1 → 1.1.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 +1 -1
- package/src/builders.js +0 -66
- package/src/transform/visitors/Attribute.js +6 -13
package/package.json
CHANGED
package/src/builders.js
CHANGED
|
@@ -648,72 +648,6 @@ export function $instrument(value) {
|
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
650
|
|
|
651
|
-
export function $getBindingProp(object, value, body) {
|
|
652
|
-
return {
|
|
653
|
-
type: 'CallExpression',
|
|
654
|
-
callee: {
|
|
655
|
-
type: 'MemberExpression',
|
|
656
|
-
object: { type: 'ThisExpression' },
|
|
657
|
-
property: {
|
|
658
|
-
type: 'MemberExpression',
|
|
659
|
-
object: {
|
|
660
|
-
type: 'Identifier',
|
|
661
|
-
name: '$'
|
|
662
|
-
},
|
|
663
|
-
property: {
|
|
664
|
-
type: 'Identifier',
|
|
665
|
-
name: 'getBindingProp'
|
|
666
|
-
},
|
|
667
|
-
computed: false,
|
|
668
|
-
optional: false
|
|
669
|
-
},
|
|
670
|
-
computed: false,
|
|
671
|
-
optional: false
|
|
672
|
-
},
|
|
673
|
-
arguments: [
|
|
674
|
-
object,
|
|
675
|
-
{ type: 'Literal', value },
|
|
676
|
-
{
|
|
677
|
-
type: 'ArrowFunctionExpression',
|
|
678
|
-
id: null,
|
|
679
|
-
expression: false,
|
|
680
|
-
generator: false,
|
|
681
|
-
async: false,
|
|
682
|
-
params: [{ type: 'Identifier', name: 'v' }],
|
|
683
|
-
body
|
|
684
|
-
}
|
|
685
|
-
],
|
|
686
|
-
optional: false
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
export function $setBindingProp(object, value, arg) {
|
|
691
|
-
return {
|
|
692
|
-
type: 'CallExpression',
|
|
693
|
-
callee: {
|
|
694
|
-
type: 'MemberExpression',
|
|
695
|
-
object: { type: 'ThisExpression' },
|
|
696
|
-
property: {
|
|
697
|
-
type: 'MemberExpression',
|
|
698
|
-
object: {
|
|
699
|
-
type: 'Identifier',
|
|
700
|
-
name: '$'
|
|
701
|
-
},
|
|
702
|
-
property: {
|
|
703
|
-
type: 'Identifier',
|
|
704
|
-
name: 'setBindingProp'
|
|
705
|
-
},
|
|
706
|
-
computed: false,
|
|
707
|
-
optional: false
|
|
708
|
-
},
|
|
709
|
-
computed: false,
|
|
710
|
-
optional: false
|
|
711
|
-
},
|
|
712
|
-
arguments: [object, { type: 'Literal', value }, arg],
|
|
713
|
-
optional: false
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
|
|
717
651
|
export function createElement(value) {
|
|
718
652
|
return {
|
|
719
653
|
type: 'CallExpression',
|
|
@@ -52,21 +52,14 @@ export function Attribute(node, ctx) {
|
|
|
52
52
|
])
|
|
53
53
|
ctx.state.effects.push(stmt)
|
|
54
54
|
} else if (bindingId) {
|
|
55
|
-
const
|
|
56
|
-
b.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
)
|
|
55
|
+
const stmt1 = b.$effect([
|
|
56
|
+
b.assignment(b.member(bindingId, node.name), template.expressions[0])
|
|
57
|
+
])
|
|
58
|
+
const stmt2 = b.$effect([
|
|
59
|
+
b.assignment(template.expressions[0], b.member(bindingId, node.name))
|
|
61
60
|
])
|
|
62
|
-
ctx.state.effects.push(stmt)
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
bindingId,
|
|
66
|
-
node.name,
|
|
67
|
-
b.assignment(template.expressions[0], b.id('v'))
|
|
68
|
-
)
|
|
69
|
-
ctx.state.changed.push(stmt2)
|
|
62
|
+
ctx.state.effects.push(stmt1, stmt2)
|
|
70
63
|
} else {
|
|
71
64
|
const stmt = b.$effect([
|
|
72
65
|
b.setAttribute(elementId, b.literal(node.name), template.expressions[0])
|