fix(javascript): honor computed keys when naming callables, exports, requests and options (#536)

This commit is contained in:
morluto
2026-10-05 15:52:06 +08:00
committed by GitHub
parent d40502aa3b
commit 4c8dc39f43
6 changed files with 84 additions and 9 deletions
@@ -317,7 +317,9 @@ const objectProperty = (
object?.properties.find(
(property): property is t.ObjectMethod | t.ObjectProperty =>
(t.isObjectMethod(property) || t.isObjectProperty(property)) &&
propertyName(property.key) === name,
// `{[env]: vars}` has a dynamic key; treating it as `env` would claim
// the caller supplied an environment when the real key is unknown.
semanticStaticPropertyName(property.key, property.computed) === name,
) ?? null;
const objectBinding = (