ExtendScript’s conditional operator resolves expressions in the wrong order. In the case of:
true ? a : true ? b : c;
I would expect it to return a, but ExtendScript actually returns b. This behavior is a major source of latent bugs in scripts. It urgently needs to be fixed.
I first noticed this when injecting polyfills into legacy ExtendScript. Common minification plugins like terser convert if statements into ternary expressions. To avoid relying on polyfills, Adobe should either update ExtendScript to support at least ES2015 or fix this egregious bug.