[162] "Or" in ternary operator

Bugs will be moved here once resolved.

Post » Tue Feb 18, 2014 6:57 pm

https://docs.google.com/file/d/0B3iZ60F3QWxTMllKZ2ZnQTgzckU

Steps to reproduce:
1. Set "var" variable to 0 or 1 nd notice that that work fine
2. Set "var" to different value (3) - broke


Observed result:
I see same thing as when "var" equal to 0 or 1

Expected result:
I want to see smth different )

Construct 2 version: all C2 versions
    
Maybe this my misunderstand and ternary operators can't compare "or" actions by the syntax. But maybe not
B
57
S
19
G
10
Posts: 191
Reputation: 9,636

Post » Thu Feb 20, 2014 5:00 pm

Closing as not a bug. | is a logical OR, and you probably need to use parentheses to clarify the order of operations (so it's not doing e.g. var1 | (1 ? "a" : "b"))
Scirra Founder
B
402
S
238
G
89
Posts: 24,632
Reputation: 196,031


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest