Aha - thanks, that was baffling.
I'll fix the comment accordingly.

I assume you're still reviewing this.

On May 19, 2008, at 9:16 AM, P T Withington wrote:

On 2008-05-18, at 16:16 EDT, Donald Anderson wrote:

Also observed during testing is the necessity of not breaking output lines to insert /* -*- file: .... */ comments. This breaks lzunit
     test/lztest/lztest-node-options.js in a strange manner:

[exec] js: "test/lztest/lztest-node-options.js", line 108: uncaught JavaScript runtime exception: TypeError: [EMAIL PROTECTED] is not a function, it is org.mozilla.javascript.Undefined.

This is probably because Javascript has 'implicit semi-colons'. The parser rule is that if you see a line break where a semi would be accepted, pretend you saw a semi. Unfortunately that makes:

 return
 foo

Parse as:

 return;
 foo;

And your function returns no value and `foo` becomes unreachable code.

(In JS2 they have fixed this by not permitting an implicit semi between return and an expression.)


--

Don Anderson
Java/C/C++, Berkeley DB, systems consultant

voice: 617-547-7881
email: [EMAIL PROTECTED]
www: http://www.ddanderson.com




Reply via email to