Commit Graph
1 Commits
Author SHA1 Message Date
ThejeshandVincent Koc aeca62b117 fix(javascript): recover webpack chunks with array module tables (#13829)
* fix(javascript): recover webpack chunks with array module tables

Webpack writes a chunk's module table as a sparse array when numeric
module ids are dense (webpack 5 moduleIds natural/size, webpack 4
production builds), and webpack 4 registers chunks on webpackJsonp.
Chunk registration accepted only object tables and *Chunk* globals, so
these chunks recovered no modules while coverage stayed complete.

Read object, sparse-array and Array(n).concat([...]) tables through one
moduleTableEntries helper (index plus offset is the module id) and
recognize webpackJsonp as a chunk runtime.

* fix(javascript): mark webpackJsonp chunks as webpack vendor

A minified webpack 4 chunk whose factories never spell
__webpack_require__ now yields a webpackJsonp registration with
bundler "webpack", but detectVendors matched only __webpack_require__
and webpackChunk, so the same file reported no webpack vendor and the
artifact graph's vendor_markers stayed empty.

Add webpackJsonp to the webpack vendor markers, next to webpackChunk,
so the marker and the chunk-runtime classification agree. This also
covers the not-examined path, which reports vendors without
registrations.

* fix(javascript): validate intrinsic array module table offsets

* fix(javascript): guard inherited array slots in table recovery

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-11-30 22:52:55 +08:00