Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Loop inside EJS switch cases throws - Uncaught SyntaxError: Illegal break statement

$
0
0
Hi all,

We are in the middle of upgrading our code base to 3.3 from current 3.2. The last hurdle appears to be this EJS that contains a for loop inside switch cases as shown below, stripped down version of course. 

(Throws Exceptions)

...
case "checkboxes": 
    for(var i=0; i < data.options.length; i++){
%>
       <div>Can't Do This</div>
<%
    }
   break;  
...

(Works)

...
case "checkboxes": 
    for(var i=0; i < data.options.length; i++){  foo = bar+baz;    }
   break;  
...


Thanks!

Viewing all articles
Browse latest Browse all 3491

Trending Articles