Skip to content

browser: setDeep creates empty-string property on empty keys #98465

Description

@zhangLei99586

Summary

setDeep() in extensions/browser/src/browser/chrome.profile-decoration.ts:49 accesses keys[keys.length - 1] which is keys[-1] (undefined) when keys is empty. The ?? "" fallback creates a property with empty-string key on the target object.

Reproduction

Source inspection: setDeep(obj, [], value) would assign obj[""] = value.

Expected

Add early if (keys.length === 0) return; guard.

Scope

extensions/browser/src/browser/chrome.profile-decoration.ts:40-49 — 1 file, ~1 LoC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions