From 4ed02f7b8a8dda78b0105649f6e97a28de7bcc6b Mon Sep 17 00:00:00 2001 From: "nboyd%atg.com" Date: Mon, 1 Oct 2001 14:25:30 +0000 Subject: [PATCH] Fix bug: var passed = true; try { eval("/* mello /* yello */"); } catch (e) { print(e); passed = false; } print(passed); should print "true", not "false". --- js/rhino/src/org/mozilla/javascript/TokenStream.java | 12 +++--------- .../mozilla/javascript/resources/Messages.properties | 3 --- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/js/rhino/src/org/mozilla/javascript/TokenStream.java b/js/rhino/src/org/mozilla/javascript/TokenStream.java index e8beda370f98..172a0876264d 100644 --- a/js/rhino/src/org/mozilla/javascript/TokenStream.java +++ b/js/rhino/src/org/mozilla/javascript/TokenStream.java @@ -1232,15 +1232,9 @@ public class TokenStream { return getToken(); } if (in.match('*')) { - while ((c = in.read()) != -1 - && !(c == '*' && in.match('/'))) { - if (c == '\n') { - } else if (c == '/' && in.match('*')) { - if (in.match('/')) - return getToken(); - reportSyntaxError("msg.nested.comment", null); - return ERROR; - } + while ((c = in.read()) != -1 && + !(c == '*' && in.match('/'))) { + ; // empty loop body } if (c == EOF_CHAR) { reportSyntaxError("msg.unterminated.comment", null); diff --git a/js/rhino/src/org/mozilla/javascript/resources/Messages.properties b/js/rhino/src/org/mozilla/javascript/resources/Messages.properties index e8a32f0af507..3cefd3a251dc 100644 --- a/js/rhino/src/org/mozilla/javascript/resources/Messages.properties +++ b/js/rhino/src/org/mozilla/javascript/resources/Messages.properties @@ -434,9 +434,6 @@ msg.unterminated.string.lit =\ msg.oct.esc.too.large =\ octal escape too large -msg.nested.comment =\ - nested comment - msg.unterminated.comment =\ unterminated comment