Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,17 @@ The same limitation applies to `Object.defineProperties`.
Direct reexport assignments contribute all detected dependencies instead of only the last assignment.
Object spreads of `require('literal')` contribute reexports, but named properties with require-valued expressions do not.

Extended mode recognizes Webpack assignments through `__webpack_exports__` and getter maps in `__webpack_require__.d`.
For object-shaped `__webpack_modules__` tables, a literal startup module ID selects the entry factory.
Detection follows internal whole-module reexports and supported star reexports, which exclude `default` and `__esModule`.
An inlined entry can instead initialize `__webpack_exports__` with an object literal.
Unrelated factories do not contribute names when the bundle publishes the recognized entry.
Unrecognized startup expressions and unresolved internal reexports retain candidate detection.

The result contains syntactic candidates, which can include non-enumerable properties, throwing getters, and unreachable assignments.
Extended mode does not apply the default getter side-effect veto.
It does not resolve bindings or aliases, evaluate computed names, or determine runtime control flow.
It recognizes Webpack factory parameters but does not generally resolve bindings or aliases.
It does not evaluate computed names or determine runtime control flow.
Names created by dynamic expressions can therefore remain undetected, and shadowed identifiers can produce false positives.

Division and regular-expression detection remains heuristic.
Expand Down
2 changes: 1 addition & 1 deletion build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ lib/lexer.wasm: include-wasm/cjs-module-lexer.h src/lexer.c
$(WASM_LDFLAGS) $(WASM_EXTRA_LDFLAGS)

optimize: lib/lexer.wasm
${WASM_OPT} -Oz lib/lexer.wasm -o lib/lexer.wasm
${WASM_OPT} -Oz --enable-bulk-memory --strip-debug lib/lexer.wasm -o lib/lexer.wasm

clean:
rm lib/*
4 changes: 2 additions & 2 deletions include-wasm/cjs-module-lexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ void tryParseLiteralExports ();
void readExportDefinition ();
void readExportProperty ();
bool readExportsOrModuleDotExports (uint16_t ch);
void tryParseModuleExportsDotAssign ();
void tryParseExportsDotAssign (bool assign);
void tryParseModuleExportsDotAssign (uint32_t length);
void tryParseExportsDotAssign (bool assign, uint32_t length);
void tryParseObjectDefineOrKeys (bool keys);
bool identifier (uint16_t ch);

Expand Down
Loading
Loading