Commit dfe9ae2
Henrik Blum
fix: correct prePush ordering for ReadableString in object properties
When a ReadableString (created from a Readable stream) appeared as a
non-first property in an object, _push() would prepend prePush (the
opening quote) before the objectItem prefix (e.g. ',"key":'), producing
invalid JSON like {"key":"value"","data":hello"}.
Fix: separate the objectItem prefix from the data, so that prePush is
inserted between the prefix and data rather than before the prefix.
Before: '",key:value' — quote lands before comma
After: ',key:"value' — quote lands after colon, before value
Added two test cases covering ReadableStream values as non-first object
properties.1 parent 2910075 commit dfe9ae2
File tree
2 files changed
+17
-4
lines changed- src
- test-src
2 files changed
+17
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
458 | | - | |
459 | | - | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
460 | 460 | | |
| 461 | + | |
| 462 | + | |
461 | 463 | | |
462 | | - | |
| 464 | + | |
463 | 465 | | |
464 | 466 | | |
465 | 467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
277 | 288 | | |
278 | 289 | | |
279 | 290 | | |
| |||
0 commit comments