Commit 7462e73
committed
fix(jsx): report a clear error when a component returns an array
A function component returning an array failed with "str.search is not a
function". The return value did not match any branch in
JSXFunctionNode.toStringToBuffer() and fell through to escapeToBuffer(),
which expects a string, so the message pointed at an internal helper
instead of the code that has to change.
Returning an array is still not supported -- the type layer already
rejects it -- so detect the case and throw a message that names the
problem and the fix.1 parent 224d2f5 commit 7462e73
2 files changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
292 | 298 | | |
293 | 299 | | |
294 | 300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
174 | 184 | | |
175 | 185 | | |
176 | 186 | | |
| |||
0 commit comments