Repository navigation
Commit 3513e1f
committed
fix(compiler): handle OptionalCallExpression and OptionalMemberExpression in data contract site matching
The visit function in data-contracts.js only matched CallExpression and
MemberExpression node types. When the parser emits the Babel-style
OptionalCallExpression or OptionalMemberExpression (e.g. for store?.write(…)
or write?.(…)), those sites were not recognized as contract uses and were
incorrectly reported as OCTANE_DATA_CONTRACT_ESCAPE.
Add the optional node type checks to all four locations:
- visit: CallExpression → also OptionalCallExpression
- visit: callee MemberExpression → also OptionalMemberExpression
- visit: standalone MemberExpression checks → also OptionalMemberExpression
- contractsOf: namespace MemberExpression → also OptionalMemberExpression
This is consistent with the rest of the compiler, which handles both shapes
throughout (descriptor-lowering, signal-declarations, dom-bindings, etc.).1 parent b1dd2c1 commit 3513e1f
1 file changed
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
| 272 | + | |
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
285 | 288 | | |
286 | 289 | | |
287 | 290 | | |
| |||
315 | 318 | | |
316 | 319 | | |
317 | 320 | | |
318 | | - | |
319 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
320 | 324 | | |
321 | 325 | | |
322 | 326 | | |
| |||
0 commit comments