knockout / tko

🥊 Technical Knockout – The Monorepo for Knockout.js (4.0+)
http://www.tko.io
Other
275 stars 34 forks source link

Incorrect tree with multiple 'or' operators in parser #153

Closed IonKiwi closed 3 years ago

IonKiwi commented 3 years ago

The following expression

false === true || false === false || true === true

should evaluate to true (but it does not)

in Node.ts, create_root(), the resulting tree (for false === true || false === false || true === true), looks like:

(false === true) || (false === (false || true === true))

Demo: https://jsfiddle.net/ionkiwi/oqkr16um/1/

Screenshot of the resulting tree: tree2

Seems to especially trigger when using multiple or statements

IonKiwi commented 3 years ago

Took another look at the open issues/pull requests. Seems there is already a pull request that resolves this: https://github.com/knockout/tko/pull/151