Skip to content

Using "to" in accessor leads to SyntaxError: Property name expected after dot (char 10)  #2027

@f1nality

Description

@f1nality

When trying to parse string "elements.to.value" i'm getting:
SyntaxError: Property name expected after dot (char 10)

mathjs: "7.5.0

i've found that there are
const NAMED_DELIMITERS = {
mod: true,
to: true,
in: true,
and: true,
xor: true,
or: true,
not: true
}

But when using it after "." it doesn't make sense that "to" parsed as delimeter, but not accessor.
Looks like a wrong behavior, is it possible to disabled some named delimeters until issue is resolved?

using elements["to"] instead of elements.to is not a good solution for us since we are making no-code solution and it can be hard for users to understand such notation and I can't transform it underhood since even parse is not working.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions