Commit 208d8b9
committed
fix(lazy-patch): address review feedback on PR #44
- LazyObject.__newindex: raise on non-string keys instead of silently
recording an unreadable patch (Copilot C3).
- Remove unused has_patches / has_deletions helpers (Copilot C2).
- encode_with_patches: classify each patch in a single qjson_cursor_field_bytes
pass (was doing two) and propagate unexpected return codes via check()
(Copilot C4 + CodeRabbit R6).
- encode_lazy_object_walking_with_patches: propagate unexpected
qjson_cursor_field_bytes return codes (CodeRabbit R7).
- lazy_object_iter: same error-propagation fix (CodeRabbit R5).
- tests/lua/lazy_patch_spec.lua: extend special-key test to verify encoded
output, swap the unicode test to multi-byte UTF-8, add "delete non-existent
field", "all originals deleted + new fields added", and "non-string key
raises" cases (CodeRabbit R8/R9/R10 + nitpick N2).
- docs/lazy-patch-spec.md: add upfront note that the listing is design
pseudocode (pointing helper names at qjson_cursor_field_bytes), and
correct the patch-record example to include lua_value alongside
encoded_value (CodeRabbit R1 + nitpick N3).1 parent 176558a commit 208d8b9
3 files changed
Lines changed: 70 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
56 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
57 | 62 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 63 | + | |
| 64 | + | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| |||
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
108 | | - | |
| 111 | + | |
| 112 | + | |
109 | 113 | | |
110 | | - | |
111 | | - | |
| 114 | + | |
112 | 115 | | |
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
| 119 | + | |
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
121 | | - | |
| 125 | + | |
122 | 126 | | |
123 | | - | |
124 | | - | |
| 127 | + | |
125 | 128 | | |
126 | 129 | | |
127 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| |||
324 | 325 | | |
325 | 326 | | |
326 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
327 | 331 | | |
328 | 332 | | |
329 | 333 | | |
| |||
515 | 519 | | |
516 | 520 | | |
517 | 521 | | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | 522 | | |
533 | 523 | | |
534 | 524 | | |
| |||
637 | 627 | | |
638 | 628 | | |
639 | 629 | | |
| 630 | + | |
| 631 | + | |
640 | 632 | | |
641 | 633 | | |
642 | 634 | | |
| |||
650 | 642 | | |
651 | 643 | | |
652 | 644 | | |
653 | | - | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
654 | 648 | | |
655 | | - | |
656 | | - | |
| 649 | + | |
657 | 650 | | |
658 | 651 | | |
659 | 652 | | |
660 | | - | |
661 | 653 | | |
662 | 654 | | |
663 | 655 | | |
664 | 656 | | |
665 | 657 | | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
666 | 662 | | |
667 | | - | |
668 | 663 | | |
669 | 664 | | |
670 | | - | |
671 | | - | |
| 665 | + | |
| 666 | + | |
672 | 667 | | |
673 | 668 | | |
674 | 669 | | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | 670 | | |
687 | 671 | | |
688 | 672 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
245 | 249 | | |
246 | 250 | | |
247 | 251 | | |
248 | 252 | | |
249 | | - | |
250 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
251 | 256 | | |
252 | 257 | | |
253 | 258 | | |
254 | | - | |
| 259 | + | |
255 | 260 | | |
256 | 261 | | |
257 | 262 | | |
| |||
273 | 278 | | |
274 | 279 | | |
275 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
276 | 313 | | |
277 | 314 | | |
278 | 315 | | |
| |||
0 commit comments