Status: New
Owner: ----

New issue 2220 by [email protected]: Peculiar syntax error thrown with octal literals in strict mode
http://code.google.com/p/v8/issues/detail?id=2220

Running the attached HTML file in Chrome throws a wrong error:

  SyntaxError: Unexpected token }

This happens in both Chrome 20 stable and 22 canary. As soon as you remove one letter "a" in the comments, the correct error is thrown:

  SyntaxError: Octal literals are not allowed in strict mode.

This seems like a bug, since the "a" is part of a comment, so it should have no effect on the program.

Not altering the comment but modifying the functions as such:

  a = function() {
  };
    b = function() {
      01;
    };

also throws the correct error.

De-indenting the "b" function however does not, and throws the wrong error.

I've no idea why this is; I would be interested in hearing a brief explanation of this behaviour if someone has the time.

Attachments:
        bug.html  1.0 KB

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to