Commit 23ac46e
committed
Improve the QuickJS update function scanning
* Noticed some design documents crashing because they are missing some of the
expected `req` fields. When an early `TypeError("req.form is undefined")`
error is thrown, it shortcuts the evaluation and we're missing covering that
ddoc. To fix it, fill out [1] more of the mock request object so we get better
coverage in the scanner.
* Handle error raised from the update function similar to how we handle other
such errors in other function. From update functions they look like
`render_error`.
[1] https://docs.couchdb.org/en/stable/json-structure.html#request-object1 parent 1c00539 commit 23ac46e
File tree
2 files changed
+40
-4
lines changed- src/couch_quickjs
- src
- test
2 files changed
+40
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
67 | 92 | | |
68 | 93 | | |
69 | 94 | | |
| |||
716 | 741 | | |
717 | 742 | | |
718 | 743 | | |
| 744 | + | |
| 745 | + | |
719 | 746 | | |
720 | 747 | | |
721 | 748 | | |
| |||
767 | 794 | | |
768 | 795 | | |
769 | 796 | | |
770 | | - | |
771 | | - | |
| 797 | + | |
772 | 798 | | |
773 | 799 | | |
774 | 800 | | |
775 | 801 | | |
776 | | - | |
| 802 | + | |
777 | 803 | | |
778 | 804 | | |
779 | 805 | | |
| |||
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
654 | | - | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
655 | 665 | | |
656 | 666 | | |
657 | 667 | | |
| |||
0 commit comments