Skip to content

engine: bound this, and promisify / partial as transparent wrappers - #1802

Merged
swapnilpaliwal-sd merged 1 commit into
apps/integration-0.1.9from
apps/javascript/bound-function-identity-and-bound-this
Sep 30, 2026
Merged

swapnilpaliwal-sd merged 1 commit into
apps/integration-0.1.9from
apps/javascript/bound-function-identity-and-bound-this

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor
  • JavaScript: f.bind(o) now gives f's this the value of o (objects and instances, and only for functions no class owns). So this.repo.append() inside a handler bound to { repo } resolves, including when a helper does the handler.bind(context).
  • JavaScript: util.promisify(f) now evaluates to whatever f holds. It is recognised from the import of the core util module, so a project's own promisify is unaffected. A field set from promisify(x.m.bind(x)) now resolves to x.m.
  • TypeScript: a declared this: T parameter now types this inside the function. The compiler oracle's labels now drop that parameter, as the engine's labels already do.
  • Python: a functools.partial(...) call now points to its target wherever the value goes (an attribute, an argument), not only when it is held in a local name.
  • Tests: new cases js/73-bound-function-identity and ts/84-declared-this-parameter, and py/08-callables is extended. Each has controls: .call, bind(null), an open fn.bind, an own promisify, this: any, a class member, a partial over a builtin. Both new cases failed before the rules were added.

Checked: JS 89/89, TS 98/98 with oracle, Python 42/42 (torture agree 587, unchanged). On a JS product: probes 46 → 47 with none regressed; edges 0 added, 0 removed, 16 sites re-targeted to a new target, 2 re-tiered.

…rtial are transparent

- javascript: f.bind(o) gives f's this the value of o (objects and instances, functions no
  class owns), so this.repo.append() inside a handler bound to { repo } resolves
- javascript: util.promisify(f) evaluates to what f holds, recognised on the import of the
  core util module; a project's own promisify is untouched
- typescript: a declared this parameter types this inside the function; the compiler
  oracle's labels drop it, as the engine's do
- python: a functools.partial call denotes its target wherever it goes (attribute,
  argument), not only in a local name

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit e6fd0c3 into apps/integration-0.1.9 Sep 30, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the apps/javascript/bound-function-identity-and-bound-this branch September 30, 2026 02:01
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