compiled-package instance methods not callable (dayjs.format, chalk.green) — prototype-method dispatch gap #838
Description
Surfaced by the #805 npm sweep harness (tier1 list, two distinct packages hit the same shape).
Repro 1 — dayjs
```ts
import dayjs from "dayjs";
const d = dayjs("2024-01-02");
console.log("d:", typeof d); // object ✓
console.log("d.format:", typeof (d as any).format); // undefined ✗ (Node: function)
```
Repro 2 — chalk
```ts
import chalk from "chalk";
console.log("chalk:", typeof chalk); // function (Node: object/proxy)
console.log("chalk.green:", typeof (chalk as any).green); // throws "value is not a function"
```
Both packages succeed at compile + link under `perry.compilePackages` but the instance / static surface that's assigned via JS-classic patterns (`Dayjs.prototype.format = ...`, chalk's Proxy-wrapped function instance) is empty at runtime.
Why this matters
This blocks a whole class of npm packages — anything that:
- assigns methods to a class prototype outside the `class { ... }` syntax (the JS-classic pattern), or
- exports a callable that also has properties (chalk, express, ms-as-function-with-props, …)
The `Dayjs.prototype.format = function(){...}` pattern is the obvious test case. Once that lands, chalk's shape (`Function & { green, red, ... }`) is the harder follow-up — it likely needs Proxy/callable-object support in the compiled-package codegen.
Status against existing trackers
Probably the same family as #618 (IIFE-namespace function-static properties) but the call site is now "npm-installed package, not user code," so the surface is much larger. Not a duplicate — keeping this open so the sweep CSV has a single ticket to point at when dayjs/chalk move from `run-fail` to `pass`.
Activity
fix: #838 followup (b) — function-decl prototype-method dispatch for …
fix: #838 followup (b) — function-decl prototype-method dispatch for …
test(regression): #838 followup (c) — lock in this.<protoMethod>() in…
test(regression): #838 followup (c) — lock in this.<protoMethod>() in…
test(regression): #838 followup (c) — lock in this.<protoMethod>() in…
test(regression): #838 followup (c) — lock in this.<protoMethod>() in…
fix(cjs_wrap): flat-emit `module.exports = <Class>` that closes over …
fix(compile,runtime): 14 walls from Next.js standalone compile valida…
fix(compile,runtime): 14 walls from Next.js standalone compile valida…
fix(hir): hoist top-level `var` entry slot in function-expression bod…