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.)

Reply via email to