File: conditional.js

package info (click to toggle)
kjs 5.103.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,020 kB
  • sloc: cpp: 36,704; javascript: 5,079; yacc: 790; perl: 191; sh: 52; makefile: 7
file content (9 lines) | stat: -rw-r--r-- 253 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
shouldBe("true ? 1 : 2", "1");
shouldBe("false ? 1 : 2", "2");
shouldBe("'abc' ? 1 : 2", "1");
shouldBe("null ? 1 : 2", "2");
shouldBe("undefined ? 1 : 2", "2");
var a = 1;
if ( undefined )
  a = 2;
shouldBe("/*var a=1;if (undefined) a = 2;*/ a", "1");