Fix do..while without trailing semi-colon

This commit is contained in:
Gordon Williams 2014-11-12 09:02:29 +00:00
parent 5e17564d33
commit 0ebed4a415
3 changed files with 13 additions and 1 deletions

View File

@ -3,6 +3,7 @@
Allow arrays to be passed to digitalPulse so square waves can be created easily
Force inlining of jsvLock/UnLock on most systems - improves performance a lot
Fix issues with SPI.write, CS, and out of sync receive bytes
Fix do..while without trailing semi-colon
1v71 : Allowed WIZnet + CC3000 to be instantiated on any pins
Fix break inside loop inside case inside function (fix 428)

View File

@ -1711,7 +1711,7 @@ NO_INLINE JsVar *jspeStatementDoOrWhile(bool isWhile) {
if (!loopCond) jspSetNoExecute();
execInfo.execute |= EXEC_IN_LOOP;
jsvUnLock(jspeBlockOrStatement());
JslCharPos whileBodyEnd = jslCharPosClone(&execInfo.lex->tokenStart);
execInfo.execute &= (JsExecFlags)~EXEC_IN_LOOP;
if (execInfo.execute == EXEC_CONTINUE)
execInfo.execute = EXEC_YES;
@ -1731,6 +1731,9 @@ NO_INLINE JsVar *jspeStatementDoOrWhile(bool isWhile) {
JSP_MATCH(')');
}
JslCharPos whileBodyEnd;
whileBodyEnd = jslCharPosClone(&execInfo.lex->tokenStart);
while (!hasHadBreak && loopCond
#ifdef JSPARSE_MAX_LOOP_ITERATIONS
&& loopCount-->0

View File

@ -0,0 +1,8 @@
function test(){
var i=0;
do{
console.log(i++);
} while (i < 10)
}
test();
result=1;