Skip to content

get helper returns undefined when the key is a string containing a period #21411

Description

@fdeters

🐞 Describe the Bug

Ember's get helper from @ember/helper can't handle accessing a value in an object when the key is a string with a dot in it.

E.g. applying {{ get obj 'some.key' }} to const obj = { 'some.key': 'some value' };will returnundefinedrather than'some value'`.

🔬 Minimal Reproduction

See description above and this reproduction on latest Ember: Repro on Limber

😕 Actual Behavior

Ember's get helper returns undefined when attempting to access a key that is a string containing a period.

🤔 Expected Behavior

I expect the get helper to handle accessing keys on objects just like vanilla JavaScript does. Barring that, I expect clear documentation about the different behavior.

🌍 Environment

  • Ember: 6.12.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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