Skip to content

Error parsing Binding expressions with Operators == and != in reference Build #290

@dvHuett

Description

@dvHuett

Description:

Using bindings with operators == or != (e.g. <div data-bind="if: value() != null">) will throw an exception “unexpected nodes remain in shunting yard output stack” while trying to parse.

After inspecting the code, it looks like the == and != operators are overridden in the reference build, but their precedence is not preserved/assigned on the overridden operator functions. This causes the shunting-yard reduction to leave pending operators, which then triggers the parser error.

Expected behavior:

Expressions with == or != should parse normally.

Actual behavior:

Bindings using == or != throw a parser error at runtime.

Environment:

TKO reference build: 4.0.0 (npm package @tko/build.reference)

Metadata

Metadata

Assignees

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