Login
Artifact [fabeefdd91]
Login

Artifact fabeefdd91c5c0d5996d0ff7efcf1654c794f2e0:




/* note that the semicolons here are needed for the assert, not the if/else blocks */
assert if(1){};
assert !if(0){throw __FLC};
assert !if(0){throw __FLC}else{};
assert if(0){throw __FLC} else if(1){} else{throw __FLC};

assert if(0){throw __FLC}
       else if(true)<<<_FI /*trued the second time*/;; _FI
       else {throw __FCL};
assert true /* Just checking tail consumption */;
assert !if(0){throw __FLC}
       else if(1-2+1){throw __FLC}
       else {};

var a;
if(0){throw __FLC}
else if(0){throw __FLC}
else{a=4*2-1} /* note no semicolon needed here */
assert 7 === a;
assert 7 === a /* make sure previous one wasn't skipped */;

a = 0;
if(0) throw __FLC; else if(1) a = 1; else throw __FLC;
assert 1 === a;

a = -1;
if(1) a = 0; else if(1) {throw __FLC} else {throw __FLC}
assert 0 === a;

a = 0;
if(0) throw __FLC; else if(0) {throw __FLC} else a = 1 ? 2 : 3;
assert 2 === a;

a = 0;
if(0) throw __FLC; else if(0) {throw __FLC} else {a = 0 ? 2 : 3}
assert 3 === a;

assert var ex = catch{
    if(0) 1; else if(0) else a = 1 ? 2 : 3;
};
assert 'CWAL_SCR_SYNTAX' === ex.codeString();
assert 0 < ex.message.indexOf('consecutive non-operators');

a = 0;
assert true === if(1) 1; else throw __FLC;
assert false === if(0) throw __FLC; else if(0) throw __FLC;
a = 1;
assert 1 === a /* make sure final if() DTRT */;

a = 0;
assert false === if(0) throw __FLC; else if(0) {0};
a = 1;
assert 1 === a /* make sure final if() DTRT */;

a = 0;
assert true === if(0) throw __FLC; else if(1) {0};
a = 1;
assert 1 === a /* make sure final if() DTRT */;

a = 0;
assert true === if(0) 1; else if(1) 0;
a = 1;
assert 1 === a /* make sure final if() DTRT */;

a = 0;
assert true === if(1) 1; else if(1) {throw __FLC};
a = 1;
assert 1 === a /* make sure final if() DTRT */;

a = 0;
assert true === if(1) 1; else if(1) throw __FLC;
a = 1;
assert 1 === a /* make sure final if() DTRT */;

if(1){}
var b;

if(0){} else{}
var b2;

if(0){} else if(0){}
var b3;

if(0){}
var c;