Can I prevent stupid errors in JavaScript because the language does not require semicolons?
<p>I just lost quite a bit of time because I changed a JavaScript function that read (something like) </p>

<pre><code>function F(a,b,c) {

    return x(a,b,c) +
           y(a,b,c) + 
           z(a,b,c);
}
</code></pre>

<p>to</p>

<pre><code>function F(a,b,c) {

    return // x(a,b,c) +
           y(a,b,c) + 
           z(a,b,c);
}
</code></pre>

<p>when I needed to test something.</p>

<p>The changed function returns <code>undefined</code>, of course, because the language does not require a semicolon and assumes the <code>return</code> to be a complete statement.</p>

<p>Unfortunatly, when I commented out <code>x(a,b,c)</code> I didn't think of this implication. So, is there a way to prevent such stupid misstakes in the future.</p>
