Skip to content

[fix] parse: fix reviver not recursing into nested objects#5

Merged
ljharb merged 1 commit intoljharb:mainfrom
deepview-autofix:deepview/75a90de18cb45870a391e1825adbb8136307dccdafc2ee9126d0da4a618be35c
Apr 15, 2026
Merged

[fix] parse: fix reviver not recursing into nested objects#5
ljharb merged 1 commit intoljharb:mainfrom
deepview-autofix:deepview/75a90de18cb45870a391e1825adbb8136307dccdafc2ee9126d0da4a618be35c

Conversation

@deepview-autofix
Copy link
Copy Markdown
Contributor

The walk function in the reviver implementation was iterating over the
'value' function instead of 'val' (the current object node). This prevented
the reviver from being called for nested properties.

Changed: for (k in value) to for (k in val)

This ensures the reviver function is properly called for all nested objects
and arrays, matching the behavior of native JSON.parse.

The walk function in the reviver implementation was iterating over the 'value' function instead of 'val' (the current object node).
This prevented the reviver from being called for nested properties.

Changed: for (k in value) to for (k in val)

This ensures the reviver function is properly called for all nested objects and arrays, matching the behavior of native JSON.parse.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: DeepView Autofix <276251120+deepview-autofix@users.noreply.github.com>
Co-Authored-By: Nikita Skovoroda <chalkerx@gmail.com>
Signed-off-by: Nikita Skovoroda <chalkerx@gmail.com>
@ljharb ljharb force-pushed the deepview/75a90de18cb45870a391e1825adbb8136307dccdafc2ee9126d0da4a618be35c branch from 7d9131e to 3c90840 Compare April 15, 2026 16:05
@ljharb ljharb force-pushed the deepview/75a90de18cb45870a391e1825adbb8136307dccdafc2ee9126d0da4a618be35c branch 2 times, most recently from ba2b26e to a4adae6 Compare April 15, 2026 16:31
@ljharb ljharb merged commit a4adae6 into ljharb:main Apr 15, 2026
405 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants