fix(javascript): keep exact empty require paths and request fields

Migrate the remaining `""`-sentinel consumers from #783 to the nullable
`semanticStaticPropertyKey`: CommonJS module origins
(`require("m")['']`), require destructuring (`const {'': a} =
require("m")`), and request body fields (`{ '': value }`). Dynamic keys
still produce no link or field. API selectors that compare against known
names are unchanged.

Fixes #783

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Iwakurakaoru0822
2026-10-06 20:38:11 -07:00
co-authored by Claude Opus 5.5
parent f7954a8fd6
commit ad1f6b508f
3 changed files with 55 additions and 10 deletions
+2 -2
View File
@@ -405,8 +405,8 @@ const requestFields = (
if (!t.isObjectProperty(property)) return [];
// `{[key]: 1}` sends no knowable field name; reporting `key` would invent
// a request field that may not exist.
const name = semanticStaticPropertyName(property.key, property.computed);
if (name.length === 0) return [];
const name = semanticStaticPropertyKey(property.key, property.computed);
if (name === null) return [];
return [
{
name,