Skip to content

Property indexers not working as intended? #16

Closed
@julealgon

Description

@julealgon

While attempting to access a specific property on my template, the following syntax does not appear to be working as documented:

{ {value: @p[propName]} }

When running the application, the Value property is not emitted in the final log.

However, these work:

  • { {value: @p['propName']} }
  • { {value: @p.propName} }

The documentation mentions that anything that is a valid identifier can be used directly, and "non-identifiers" can be single quoted. propName is a valid identifier, however it is not working without the single quotes for me.

In particular, there is this section in the readme:

Data type Description Examples
Object A mapping of string keys to values; keys that are valid identifiers do not need to be quoted {a: 1, 'b c': 2, d}

If a is a "valid identifier that doesn't need to be escaped", then my property name shouldn't need to as well.

I suspect either the documentation is a bit misleading when talking about these indexers, or there is a bug in the interpreter that is not allowing this to work as it should.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions