Skip to content

Language record

JavaScript

JavaScript is indexed per file with real containment — a class's methods, its accessors and its X.prototype.m = fn assignments are recorded as symbols the class owns — and CommonJS export shapes are read, not just ESM ones.

.js, .cjs, .mjs, .jsx · 1 registry id · 12 of 14 relationship types

The registry row this page is generated from

Read at render time from the same family row the register reads, so nothing in this block can disagree with it.

Extensions
.js, .cjs, .mjs, .jsx
Registry names
javascript
Recorded symbols
functions · classes · methods

Relationship types this analyzer constructs

12 of 14 constructed, read from this analyzer's source and re-derived by the languages gate. Each row below is one of the engine's types, in the engine's own order.

Relationship typeConstructed
callsconstructed by this analyzer
extendsconstructed by this analyzer
implementsruled absent
usesconstructed by this analyzer
importsconstructed by this analyzer
exportsconstructed by this analyzer
containsconstructed by this analyzer
referencesconstructed by this analyzer
overridesconstructed by this analyzer
instantiatesconstructed by this analyzer
decoratesconstructed by this analyzer
rendersconstructed by this analyzer
mixes_inconstructed by this analyzer
part_ofruled absent

12 constructed, 2 not constructed. All 2 absent types are recorded as ruled absent: the written reason and the corpus measurement behind each are in this family's completeness record. The register explains what each label means.

What this analyzer does not resolve

  • A CommonJS require("m") says the module was loaded, not which member was taken, so the edge names the module as a wildcard and is published as unresolved rather than guessed at.
  • A computed call names no callee: handlers[key]() records no call edge at all.
  • An override of a base declared in another file cannot be verified from this file alone. It falls back to the first parent in the hierarchy, published at a lower confidence with the guess marked as one.

Every line above was written against JavaScript’s own analyzer module and is named against a construct in it, so it can be checked against the source. Nothing here is inherited from a template, or from another language’s page.

Where you meet it in a repository

Recognised by extension — .js, .cjs, .mjs, .jsx. Everything below is about where those files actually sit in a working repository.

  • A package usually mixes CommonJS require and ESM import, sometimes for one dependency, so both edge shapes appear in a single repository.
  • Pre-ES6 libraries attach methods with X.prototype.m = fn, which bb records as members the class owns rather than as loose functions.
  • A bundler emits one very large generated .js per entry point, so the same class can appear twice — once as source, once inside the build.

Questions this index answers

Phrased as retrievals, because that is what an index can honestly do: it holds the symbols and the edges between them, and hands them back with the evidence attached.

  1. Which functions call this one?
  2. Which methods belong to this class, including ones added on the prototype?
  3. What does this module export, including its CommonJS exports?
  4. Which decorators does this component carry?

What the analyzer sees in code like this

A class, a method, and a prototype method — three symbols owned by one class
import { Store } from "./store";

export class Cart extends Store {            // bb records: class Cart · extends Store
  total() { return this.items.length }       // bb records: method total
}

Cart.prototype.clear = function () {         // bb records: method clear on Cart
  this.items = []
}

Symbols are stored with the file they came from and the bytes they span, so a hit points at a line rather than at a guess. The annotations in the sample are commentary for the reader, not strings the index would store.

Languages that turn up in the same repository

Application & systems — the count beside each name is how many relationship types that family’s analyzer constructs.

The extensions, registry names, recorded symbols and relationship types above are the parser registry row for JavaScript, read while the page rendered — the same row the register reads, so the two surfaces cannot tell two stories. Every relationship type listed as constructed appears in src/ast/real-*, the analyzer modules bb ships. bb 0.1.0 answers from a local store over 50 languages (53 registry ids, three of them aliases). There is no benchmark on this page: every claim here is one you can go and read in the source.