Repository navigation
engine: bound this, and promisify / partial as transparent wrappers - #1802
Merged
swapnilpaliwal-sd merged 1 commit intoSep 30, 2026
Conversation
…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
requested review from
JaredHLZhang,
Whua689 and
suyashpaliwal26
as code owners
September 30, 2026 01:22
swapnilpaliwal-sd
deleted the
apps/javascript/bound-function-identity-and-bound-this
branch
September 30, 2026 02:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
f.bind(o)now givesf'sthisthe value ofo(objects and instances, and only for functions no class owns). Sothis.repo.append()inside a handler bound to{ repo }resolves, including when a helper does thehandler.bind(context).util.promisify(f)now evaluates to whateverfholds. It is recognised from the import of the coreutilmodule, so a project's ownpromisifyis unaffected. A field set frompromisify(x.m.bind(x))now resolves tox.m.this: Tparameter now typesthisinside the function. The compiler oracle's labels now drop that parameter, as the engine's labels already do.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.js/73-bound-function-identityandts/84-declared-this-parameter, andpy/08-callablesis extended. Each has controls:.call,bind(null), an openfn.bind, an ownpromisify,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.