-
-
Notifications
You must be signed in to change notification settings - Fork 82.1k
usage-bar: in operator matches Object.prototype inherited properties #98466
Copy link
Copy link
Closed
Labels
P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Activity
Metadata
Metadata
Assignees
Labels
P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
The usage bar translator in
src/auto-reply/usage-bar/translator.tsuseskey in tablefor alias vocabulary lookup (line 133) and segment case table lookup (line 203). Theinoperator traverses the prototype chain, so keys liketoString,valueOf,constructorincorrectly matchObject.prototypeproperties instead of falling through to the intended fallback/default behavior.Reproduction
When a usage template has an alias table or map case table, and the lookup key is
"toString"or"constructor",inreturns true even when those are not own properties.Expected
Use
Object.hasOwn(table, key)(ES2022) to check only own properties.Scope
src/auto-reply/usage-bar/translator.ts:133,203— 1 file, 2 lines.