Skip to content

fix(util): implement debuglog logger factory (#3430)#3528

Merged
proggeramlug merged 1 commit into
mainfrom
fix/3430-debuglog-debug
May 31, 2026
Merged

fix(util): implement debuglog logger factory (#3430)#3528
proggeramlug merged 1 commit into
mainfrom
fix/3430-debuglog-debug

Conversation

@proggeramlug
Copy link
Copy Markdown
Contributor

@proggeramlug proggeramlug commented May 31, 2026

Implements util.debuglog(section) — the runtime logger (util_debuglog_logger_value), whitelist, value-gate, and dispatch arm already existed, but the symbol had no API-manifest entry so imports failed the #463 R005 unimplemented gate. Adds the manifest entries for debuglog (mirrored into the deprecated sys alias to keep sys_alias_mirrors_util_manifest balanced).

Byte-for-byte identical to node --experimental-strip-types:

typeof util.debuglog        → function
util.debuglog("x")          → function; calling it (NODE_DEBUG unset) → undefined

The util.debug alias requested in #3430 is deferred: its value-read+call path resolves differently from the method-call dispatch and returns undefined; tracking that separately so this lands the working logger factory first.

@proggeramlug proggeramlug force-pushed the fix/3430-debuglog-debug branch 2 times, most recently from 5f4658e to 785b5a5 Compare May 31, 2026 05:52
@proggeramlug proggeramlug changed the title fix(util): implement debuglog logger factory and debug alias (#3430) fix(util): implement debuglog logger factory (#3430) May 31, 2026
@proggeramlug proggeramlug force-pushed the fix/3430-debuglog-debug branch from 785b5a5 to 7389960 Compare May 31, 2026 06:09
@proggeramlug proggeramlug merged commit 44cf69c into main May 31, 2026
1 check passed
@proggeramlug proggeramlug deleted the fix/3430-debuglog-debug branch May 31, 2026 06:10
proggeramlug pushed a commit that referenced this pull request May 31, 2026
The committed artifacts were one batch stale relative to
crates/perry-api-manifest/src/entries.rs: #3528 (util.debuglog factory)
dropped the `util.debug` / `sys.debug` alias from the manifest but the
merge didn't regenerate docs, leaving main red on the api-docs-drift
gate (committed docs claim 1996 entries; manifest has 1994). Re-run of
`./scripts/regen_api_docs.sh` — no manifest change in this PR, purely a
catch-up regeneration.
proggeramlug added a commit that referenced this pull request May 31, 2026
…3149) (#3530)

* fix(es5): Object(value) plain-call coercion returns a fresh object (#3149)

Bug 1 of #3149. `Object()` / `Object(undefined)` / `Object(null)` called
as a plain function (not `new`) returned `undefined` — the bare-call path
fell through to the generic dispatcher. Per ECMAScript §20.1.1.1 these
yield a fresh ordinary `{}`; an existing object/array/function passes
through unchanged; a primitive coerces to an object (typeof "object").

Adds an `Expr::ObjectCoerce(value)` HIR variant (mirroring `StringCoerce`)
lowered from the shadow-safe bare `Object(...)` call, a `js_object_coerce`
runtime helper (nullish/primitive -> fresh `{}`, pointer passes through),
and codegen emission + the operand-recursing collector/walker arms. The
`new Object(null)` path already worked via `js_new_function_construct`.

Gap test `test_gap_3149_object_coerce.ts` is byte-identical to
`node --experimental-strip-types`.

Bug 2 (function-declaration reassignment) is intentionally deferred — see
the follow-up issue; it needs mutable-binding-slot routing across the
FuncRef read / call / `new` lowering sites and human review before landing.

* chore(lint): allowlist process.rs in the file-size gate

`crates/perry-runtime/src/process.rs` reached 2047 LOC on main after the
node:process argument-validation batch (#3493/#3516/#3518/#3496) landed
without a split, tripping the whole-tree file-size gate and turning every
open PR's `lint` check red. Add it to the allowlist with a rationale,
mirroring the existing entries; the per-concern split is tracked under
#1435.

* docs: regenerate API reference + .d.ts to match the manifest

The committed artifacts were one batch stale relative to
crates/perry-api-manifest/src/entries.rs: #3528 (util.debuglog factory)
dropped the `util.debug` / `sys.debug` alias from the manifest but the
merge didn't regenerate docs, leaving main red on the api-docs-drift
gate (committed docs claim 1996 entries; manifest has 1994). Re-run of
`./scripts/regen_api_docs.sh` — no manifest change in this PR, purely a
catch-up regeneration.

---------

Co-authored-by: Ralph Küpper <ralph@skelpo.com>
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.

1 participant