Skip to content

pr-writer-impl lower level impl for js object printing, removes several dependencies #256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/main/cljs/cljs/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -10529,9 +10529,15 @@ reduces them without incurring seq initialization"
(do
(-write writer "#js ")
(print-map
(map (fn [k]
(MapEntry. (cond-> k (some? (re-matches #"[A-Za-z_\*\+\?!\-'][\w\*\+\?!\-']*" k)) keyword) (unchecked-get obj k) nil))
(js-keys obj))
(.map
(js-keys obj)
(fn [k]
(reify
IMapEntry
(-key [_]
(cond-> k (some? (.match k #"^[A-Za-z_\*\+\?!\-'][\w\*\+\?!\-']*$")) keyword))
(-val [_]
(unchecked-get obj k)))))
pr-writer writer opts))

(array? obj)
Expand Down
Loading