diff -r 815bbd31a33c -r 339c826fa96c RegressionTests__JavaScriptTests.st --- a/RegressionTests__JavaScriptTests.st Wed May 29 01:55:43 2013 +0200 +++ b/RegressionTests__JavaScriptTests.st Thu Jun 06 16:58:40 2013 +0200 @@ -1206,6 +1206,78 @@ " ! +testInnerFunctionWithForLoop + + self + execute:' +execute() { + function foo() + { + Transcript.show("foo called\n"); + } + + function bar() + { + Transcript.show("bar called\n"); + } + + function bla(n) + { + Transcript.show("bla called\n"); + } + + function test() + { + + foo(); + bar(); + var _fecUs; + var _fecDs; + var _cvUs = Array.new(15); + var _cvDs = Array.new(15); + var _headerLength = 10; + var _headerLength2 = 10; + var _raw = Array.new(20); + + for(var l=_headerLength+2;l<=_raw.size;l++) + { + var x = _raw[l]; + if(l!!=_raw.size) + { var y = _raw[l+1]; } + + if(_cvUs.size >10 && _cvDs.size>10) + { + _fecUs = 15.asInteger - 12.asInteger; + _fecDs = 20.asInteger - 13.asInteger; + bla(_fecUs); + bla(_fecDs); + bla(_cvUs); + bla(_cvDs); + if(_fecUs >=0 && _fecUs >=0) + { + Transcript.show("hello\n"); + } + + } + if(_cvUs.size == 5) + { Transcript.show("end\n"); } + } + Transcript.show("bbb\n"); + } + + test(); +} +' + for:nil + arguments:#() + expect:nil + + " + self run:#testVarDeclaration08 + self new testVarDeclaration08 + " +! + testLiteralReturn01 self execute:'function f() { return (0); }' @@ -3032,7 +3104,71 @@ }' for:nil arguments:#(true 5) - expect:false + expect:false. + + self + execute:'expr(a, b) { + return (a > 10 && (b > 5)); + }' + for:nil + arguments:#(10 5) + expect:false. + + self + execute:'expr(a, b) { + return (a > 10 && (b > 5)); + }' + for:nil + arguments:#(11 5) + expect:false. + + self + execute:'expr(a, b) { + return (a > 10 && (b > 5)); + }' + for:nil + arguments:#(10 6) + expect:false. + + self + execute:'expr(a, b) { + return (a > 10 && (b > 5)); + }' + for:nil + arguments:#(11 15) + expect:true. + + self + execute:'expr(a, b) { + return (a.size > 10 && (b.size > 5)); + }' + for:nil + arguments:{Array new:10 . Array new:5} + expect:false. + + self + execute:'expr(a, b) { + return (a.size > 10 && (b.size > 5)); + }' + for:nil + arguments:{Array new:11 . Array new:5} + expect:false. + + self + execute:'expr(a, b) { + return (a.size > 10 && (b.size > 5)); + }' + for:nil + arguments:{Array new:10 . Array new:6} + expect:false. + + self + execute:'expr(a, b) { + return (a.size > 10 && (b.size > 5)); + }' + for:nil + arguments:{Array new:11 . Array new:15} + expect:true. " self run:#testOperators44a_logAnd @@ -5234,6 +5370,40 @@ " ! +xtestInnerFunctionWithInitializedLocals + + self + execute:' +execute() { + function foo() {} + function bar() {} + + function test() + { + + foo(); + bar(); + var a; + var b; + var c = Array.new(15); + var d = 20; + + return [ a , b , c , d ]; + } + + test(); +} +' + for:nil + arguments:#() + expect:{ nil . nil . (Array new:15) . 20 } + + " + self run:#testInnerFunctionWithInitializedLocals + self new testInnerFunctionWithInitializedLocals + " +! + xtestNew04 self execute:'test() {