Skip to content

javascript: path says unknown, not independent, for a callee stored on this, in a module variable, in a tested options member, or computed by an expression (#1675) - #1696

Merged
swapnilpaliwal-sd merged 2 commits into
0.1.7from
loop/ja-is1675
Sep 28, 2026
Merged

swapnilpaliwal-sd merged 2 commits into
0.1.7from
loop/ja-is1675

Conversation

@swapnilpaliwal-sd

@swapnilpaliwal-sd swapnilpaliwal-sd commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

path A B answered "the two are independent in this graph" when A's only open call went through a function value that is not a bare parameter, loop variable or local. unresolved_value_callee now also marks:

  • a module-level variable (let handler = null; … handler())
  • a function stored in a field: this.cb(), self.cb() (const self = this), a static this.cb(), new this.Ctor(), a field holding only null until a setter runs, and this.cb = cb || function () {}
  • an options-object member the code treats as an optional function: typeof test, &&/||/?? guard, if condition, ?.()
  • a callee computed by an expression ((c ? a : b)(), (0, cb)()), and new Function(s)()

Controls that stay independent: this.own(), this.emit() on a class extending a library class, path.join, res.status().send(), a bare opts.onReady(), and a module variable holding what a library call returned (const log = require('debug')('app')). One handed a project function (memo(Inner)) stays unknown.

Checked: call edges unchanged on two real Express apps (2041 → 2041, 1411 → 1411; one library-made module_variable dropped); JS goldens 73/73 (09 and 15 flaked once under load, pass alone); JS path cases 92/93 (next-step-reads-the-whole-answer fails the same way on the baseline).

Closes #1675

swapnilpaliwal-sd and others added 2 commits September 28, 2026 13:36
… function stored on this, in a module variable, in a tested options member, or through an expression (#1675)

unresolved_value_callee gains five reasons, each an unresolved call whose
callee is a value the graph does not hold:
- module_variable: `let handler = null; ... handler()`
- field: `this.cb()` where cb is a field, not a method
- parameter_member: `opts.onReady()` when the code treats the member as an
  optional function (typeof test, `&&`/`||`/`??` guard, if condition, `?.()`)
- expression: `(c ? a : b)()`, `(0, cb)()`, `make()()`
- dynamic_code: `new Function(s)()`
A bare member call on an untyped parameter (`res.send()`, `s.trim()`) is
not counted: without a type it reads the same as a library method, and
counting it turned 10 of 12 independent pairs on a real Express app into
unknown. No call edge changes.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
…iased this field, a fallback field and new this.Ctor() (#1675)

The field reason of unresolved_value_callee now covers:
- a field holding only null until a setter runs (`cb = null`, `this.cb = null`,
  `static cb = null`): the null literal no longer counts as the known value
- a static `this.cb = f` / `this.cb()` pair, known by the assignment, not a field declaration
- `self.cb()` with `const self = this`: any receiver valued as the instance or class
- `new this.Ctor()`
- `this.cb = cb || function () {}`: the call resolves to the fallback, but the
  parameter it falls back from is a function no caller in the graph supplies

A module variable initialised from a call and never reassigned
(`const log = require('debug')('app')`) is no longer a value callee: the
library made it. One handed a function (`memo(Inner)`) stays open.
`Model.tag2()` (a known-missing member of case 49) now names the field.
No call edge changes.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd changed the base branch from 0.1.6 to 0.1.7 September 28, 2026 20:48
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit 3776686 into 0.1.7 Sep 28, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the loop/ja-is1675 branch September 28, 2026 21:07
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