From 2809a2cb52caba3ba5c94bd8a182ca27206890e3 Mon Sep 17 00:00:00 2001 From: "igor%mir2.org" Date: Fri, 16 Aug 2002 06:42:27 +0000 Subject: [PATCH] Fixing line number generation for the empty return statement which was reported by Steven Beal. It was caused by missed update of lineno in statementHelper when dealing with return;. --- js/rhino/src/org/mozilla/javascript/Parser.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/rhino/src/org/mozilla/javascript/Parser.java b/js/rhino/src/org/mozilla/javascript/Parser.java index 224b2bcb476..28fa526356b 100644 --- a/js/rhino/src/org/mozilla/javascript/Parser.java +++ b/js/rhino/src/org/mozilla/javascript/Parser.java @@ -736,7 +736,6 @@ class Parser { } case TokenStream.RETURN: { Object retExpr = null; - int lineno = 0; sourceAdd((char)ts.RETURN); @@ -749,8 +748,8 @@ class Parser { tt = ts.peekTokenSameLine(); ts.flags &= ~ts.TSF_REGEXP; + int lineno = ts.getLineno(); if (tt != ts.EOF && tt != ts.EOL && tt != ts.SEMI && tt != ts.RC) { - lineno = ts.getLineno(); retExpr = expr(ts, false); if (ts.getLineno() == lineno) wellTerminated(ts, ts.ERROR);