Repository navigation
refactor: split parser into focused methods - #23
CNSeniorious000 wants to merge 1 commit into
Conversation
|
|
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/index.ts" line_range="123" />
<code_context>
+ this.skipBlank();
+ this.index++; // skip colon
+ try {
+ obj[key] = this.parseAny();
+ } catch (e) {
+ if (Allow.OBJ & this.allow) return true;
</code_context>
<issue_to_address>
**Deep objects exhaust the stack sooner**
When input contains objects nested close to the runtime’s call-stack limit, each nested object keeps a `parseObjEntry` frame alive while `this.parseAny()` recursively parses its value, adding one stack frame per object level compared with the previous parser. Deep but otherwise valid object input therefore reaches a `RangeError` at a shallower depth.
Avoid keeping a separate `parseObjEntry` frame active during recursive value parsing, or use an iterative traversal for nested objects.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: src/index.ts:123
| this.skipBlank(); | ||
| this.index++; // skip colon | ||
| try { | ||
| obj[key] = this.parseAny(); |
There was a problem hiding this comment.
🟡 Medium · Deep objects exhaust the stack sooner
When input contains objects nested close to the runtime’s call-stack limit, each nested object keeps a parseObjEntry frame alive while this.parseAny() recursively parses its value, adding one stack frame per object level compared with the previous parser. Deep but otherwise valid object input therefore reaches a RangeError at a shallower depth.
Avoid keeping a separate parseObjEntry frame active during recursive value parsing, or use an iterative traversal for nested objects.
Prompt for AI agents
In `src/index.ts` at line 123:
**Deep objects exhaust the stack sooner**
When input contains objects nested close to the runtime’s call-stack limit, each nested object keeps a `parseObjEntry` frame alive while `this.parseAny()` recursively parses its value, adding one stack frame per object level compared with the previous parser. Deep but otherwise valid object input therefore reaches a `RangeError` at a shallower depth.
Avoid keeping a separate `parseObjEntry` frame active during recursive value parsing, or use an iterative traversal for nested objects.|
No actionable comments were generated in the recent review.
|
BenchmarkCompared
Overall throughput improves, especially for objects and nested structures. Isolated partial string and number cases show a small (~3%) regression under Node. |
Summary
Verification
bun run buildbun run test --run— 6 tests passedbunx fallow— 0 complexity findings; maintainability 85.9 (good)