Skip to content

Commit db07237

Browse files
chore: revert test change
1 parent 59e2002 commit db07237

File tree

3 files changed

+125
-30
lines changed

3 files changed

+125
-30
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
22
<section>
3-
<x-pert>{foo()}</x-pert>
3+
<x-pert attr="{({ obj: 'literal' })}">{({ obj: 'literal'}).toString()}</x-pert>
44
</section>
55
</template>

packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/object-expr/ast.json

Lines changed: 115 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"endLine": 5,
88
"endColumn": 12,
99
"start": 0,
10-
"end": 84,
10+
"end": 139,
1111
"startTag": {
1212
"startLine": 1,
1313
"startColumn": 1,
@@ -21,8 +21,8 @@
2121
"startColumn": 1,
2222
"endLine": 5,
2323
"endColumn": 12,
24-
"start": 73,
25-
"end": 84
24+
"start": 128,
25+
"end": 139
2626
}
2727
},
2828
"directives": [],
@@ -37,7 +37,7 @@
3737
"endLine": 4,
3838
"endColumn": 15,
3939
"start": 15,
40-
"end": 72,
40+
"end": 127,
4141
"startTag": {
4242
"startLine": 2,
4343
"startColumn": 5,
@@ -51,8 +51,8 @@
5151
"startColumn": 5,
5252
"endLine": 4,
5353
"endColumn": 15,
54-
"start": 62,
55-
"end": 72
54+
"start": 117,
55+
"end": 127
5656
}
5757
},
5858
"attributes": [],
@@ -68,62 +68,149 @@
6868
"startLine": 3,
6969
"startColumn": 9,
7070
"endLine": 3,
71-
"endColumn": 33,
71+
"endColumn": 88,
7272
"start": 33,
73-
"end": 57,
73+
"end": 112,
7474
"startTag": {
7575
"startLine": 3,
7676
"startColumn": 9,
7777
"endLine": 3,
78-
"endColumn": 17,
78+
"endColumn": 47,
7979
"start": 33,
80-
"end": 41
80+
"end": 71
8181
},
8282
"endTag": {
8383
"startLine": 3,
84-
"startColumn": 24,
84+
"startColumn": 79,
8585
"endLine": 3,
86-
"endColumn": 33,
87-
"start": 48,
88-
"end": 57
86+
"endColumn": 88,
87+
"start": 103,
88+
"end": 112
8989
}
9090
},
9191
"attributes": [],
92-
"properties": [],
92+
"properties": [
93+
{
94+
"type": "Property",
95+
"name": "attr",
96+
"attributeName": "attr",
97+
"value": {
98+
"type": "ObjectExpression",
99+
"start": 2,
100+
"end": 20,
101+
"properties": [
102+
{
103+
"type": "Property",
104+
"start": 4,
105+
"end": 18,
106+
"method": false,
107+
"shorthand": false,
108+
"computed": false,
109+
"key": {
110+
"type": "Identifier",
111+
"start": 4,
112+
"end": 7,
113+
"name": "obj"
114+
},
115+
"value": {
116+
"type": "Literal",
117+
"start": 9,
118+
"end": 18,
119+
"value": "literal",
120+
"raw": "'literal'"
121+
},
122+
"kind": "init"
123+
}
124+
],
125+
"location": {
126+
"startLine": 3,
127+
"startColumn": 17,
128+
"endLine": 3,
129+
"endColumn": 46,
130+
"start": 41,
131+
"end": 70
132+
}
133+
},
134+
"location": {
135+
"startLine": 3,
136+
"startColumn": 17,
137+
"endLine": 3,
138+
"endColumn": 46,
139+
"start": 41,
140+
"end": 70
141+
}
142+
}
143+
],
93144
"directives": [],
94145
"listeners": [],
95146
"children": [
96147
{
97148
"type": "Text",
98-
"raw": "{foo()}",
149+
"raw": "{({ obj: 'literal'}).toString()}",
99150
"value": {
100151
"type": "CallExpression",
101152
"start": 1,
102-
"end": 6,
153+
"end": 31,
103154
"callee": {
104-
"type": "Identifier",
155+
"type": "MemberExpression",
105156
"start": 1,
106-
"end": 4,
107-
"name": "foo"
157+
"end": 29,
158+
"object": {
159+
"type": "ObjectExpression",
160+
"start": 2,
161+
"end": 19,
162+
"properties": [
163+
{
164+
"type": "Property",
165+
"start": 4,
166+
"end": 18,
167+
"method": false,
168+
"shorthand": false,
169+
"computed": false,
170+
"key": {
171+
"type": "Identifier",
172+
"start": 4,
173+
"end": 7,
174+
"name": "obj"
175+
},
176+
"value": {
177+
"type": "Literal",
178+
"start": 9,
179+
"end": 18,
180+
"value": "literal",
181+
"raw": "'literal'"
182+
},
183+
"kind": "init"
184+
}
185+
]
186+
},
187+
"property": {
188+
"type": "Identifier",
189+
"start": 21,
190+
"end": 29,
191+
"name": "toString"
192+
},
193+
"computed": false,
194+
"optional": false
108195
},
109196
"arguments": [],
110197
"optional": false,
111198
"location": {
112199
"startLine": 3,
113-
"startColumn": 17,
200+
"startColumn": 47,
114201
"endLine": 3,
115-
"endColumn": 24,
116-
"start": 41,
117-
"end": 48
202+
"endColumn": 79,
203+
"start": 71,
204+
"end": 103
118205
}
119206
},
120207
"location": {
121208
"startLine": 3,
122-
"startColumn": 17,
209+
"startColumn": 47,
123210
"endLine": 3,
124-
"endColumn": 24,
125-
"start": 41,
126-
"end": 48
211+
"endColumn": 79,
212+
"start": 71,
213+
"end": 103
127214
}
128215
}
129216
]

packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/valid/object-expr/expected.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@ const stc0 = {
66
key: 0,
77
};
88
const stc1 = {
9+
props: {
10+
attr: {
11+
obj: "literal",
12+
},
13+
},
914
key: 1,
1015
};
16+
const stc2 = {
17+
obj: "literal",
18+
};
1119
function tmpl($api, $cmp, $slotset, $ctx) {
1220
const {
1321
d: api_dynamic_text,
@@ -18,7 +26,7 @@ function tmpl($api, $cmp, $slotset, $ctx) {
1826
return [
1927
api_element("section", stc0, [
2028
api_custom_element("x-pert", _xPert, stc1, [
21-
api_text(api_dynamic_text($cmp.foo())),
29+
api_text(api_dynamic_text(stc2.toString())),
2230
]),
2331
]),
2432
];

0 commit comments

Comments
 (0)