mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
Fix do..while without trailing semi-colon
This commit is contained in:
parent
5e17564d33
commit
0ebed4a415
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
8
tests/test_do_while_semi.js
Normal file
8
tests/test_do_while_semi.js
Normal file
@ -0,0 +1,8 @@
|
||||
function test(){
|
||||
var i=0;
|
||||
do{
|
||||
console.log(i++);
|
||||
} while (i < 10)
|
||||
}
|
||||
test();
|
||||
result=1;
|
||||
Loading…
x
Reference in New Issue
Block a user