Skip to content

callbacks: a function is handed over only where it is written into the argument - #1801

Merged
swapnilpaliwal-sd merged 2 commits into
0.1.9from
apps/javascript/callback-registered-invented-at-unrelate
Sep 30, 2026
Merged

swapnilpaliwal-sd merged 2 commits into
0.1.9from
apps/javascript/callback-registered-invented-at-unrelate

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

A function was registered as a callback at every call whose argument's abstract value might hold it: Map keys, strings, promises, a key destructured from a Map of handler sets, an object literal whose member held a parameter. Config default arrows and bus handlers each collected edges from unrelated get/set/has/emit/assert sites, and path printed them as verified.

  • JS: at a project callee, only a function written at the argument (literal, declaration, import, const, method read, call result) is registered; the callee's own body carries the rest.
  • JS: an options object hands over only functions written into a literal (or the variable it initialises), at any nesting depth; the old abstract-value join is gone.
  • JS/TS: Map/Set/WeakMap/WeakSet methods other than forEach never register; TS recognises them by declared reference or new initialiser, with no lib staged.
  • Cases: JS 34 gains the near misses and the loop-key bus shape (8 invented edges before, 0 after; controls setTimeout/forEach/options literal unchanged). TS 78 gains store.ts (3 before, 0 after). JS 50 loses 2 invented edges at an Object.keys alias.

Checked: JS suite 88/88, TS 97/97; product callback_registered 1190 -> 1070 (edges 8944 -> 8824), per bus handler 11 -> 1, handler still reached via the bus's invoke; probes 46/70 -> 46/70, none regressed; index 21s -> 40s (shared VM).

…e argument

A function reached the callee of every call whose argument's abstract value might
hold it: a Map key, a string, a promise, a loop variable destructured from a Map of
handler sets, an object whose member held a parameter. Each config default arrow
and each bus handler collected edges from unrelated get/set/has/emit/assert sites.

- javascript: a project callee is registered only for a function written at the
  argument (literal, declaration, import, const, method read, call result); an
  options object only for a literal or its variable with the function written in.
- javascript, typescript: Map/Set/WeakMap/WeakSet methods other than forEach store
  and never call; TS recognises them by declared reference or `new` initialiser.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
Base automatically changed from apps/integration-0.1.9 to 0.1.9 September 30, 2026 02:25
…late

Goldens for JS case 34 and TS case 78 regenerated from the merged engine (--bless --oracle): 78 agrees with the compiler on 17/17, 34 has no missed or wrong sites.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit 667572a into 0.1.9 Sep 30, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the apps/javascript/callback-registered-invented-at-unrelate branch September 30, 2026 03:15
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