Commit abba773
fix(widgets): don't emit " " for unset chart-series String props (runtime JSON.parse)
A ColumnChart with a static series passed mx check but failed to render with a
client-side JSON.parse('Unexpected end of JSON input'). The object-list-item
builder emitted an unset String property as a single space " " instead of "".
The chart client feeds customSeriesOptions / customLayout / customConfigurations
to JSON.parse behind an empty-guard (value !== "" ? value : "{}"); a lone
space passes that guard, so the client runs JSON.parse(" ") and throws. mx check
doesn't execute the client, so it stayed green. A Pie (widget-level datasource,
no series object-list) was unaffected — the top-level String path already emitted
"".
Leave an unset String empty, matching Studio Pro and the top-level path, so the
client's empty-guard turns it into "{}". Verified: series customSeriesOptions is
now "" (was " "), zero space-valued primitives; mx check 0 errors and no
CE0463 regression across charts / DataGrid2 / Gallery.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC41 parent 455c43a commit abba773
2 files changed
Lines changed: 49 additions & 3 deletions
File tree
- mdl-examples/bug-tests
- mdl/backend/widgetobj
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1291 | 1291 | | |
1292 | 1292 | | |
1293 | 1293 | | |
1294 | | - | |
1295 | | - | |
1296 | | - | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
1297 | 1302 | | |
1298 | 1303 | | |
1299 | 1304 | | |
| |||
0 commit comments