Subject:
            Rhino request URGENT
       Date:
            Thu, 02 Dec 1999 15:58:40 -0500
      From:
            slobo@espialgroup.com
        To:
            Norris Boyd <norris@netscape.com>
 References:
            1 , 2




Hello Norris

In Rhino, the following script gives the error : "function does not always return a value" during the parsing phase. The script
runs perfectly fine in Netscape 4.61. It is an urgent requirement. Many thanks in advance.

Steven

///////////////////////////////////////////////////////SCRIPT  BEGIN  ///////////////////////////////////////////////
function test (a) {
  this.arg = a;
  if (a>20)
        return;
  return this;
}

//print = alert;

function joe() {
a = new test (20);
print (a.arg);


a = new test (25);
print (a.arg);
}

joe();
///////////////////////////////////////////////////////SCRIPT   END  ///////////////////////////////////////////////
This commit is contained in:
norris%netscape.com 1999-12-03 00:04:46 +00:00
Родитель 98862d9415
Коммит c4c76975f6
4 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -688,8 +688,9 @@ class Parser {
tt = ts.peekTokenSameLine();
ts.flags &= ~ts.TSF_REGEXP;
if (tt != ts.EOF && tt != ts.EOL
&& tt != ts.SEMI && tt != ts.RC) {
if (tt != ts.EOF && tt != ts.EOL && tt != ts.SEMI &&
tt != ts.RC && !(tt == ts.PRIMARY && ts.getOp() == ts.THIS))
{
lineno = ts.getLineno();
retExpr = expr(ts, source, false);
if (ts.getLineno() == lineno)

Просмотреть файл

@ -195,7 +195,7 @@ public class TokenStream {
INC = 105, // increment/decrement (++ --)
DEC = 106,
DOT = 107, // member operator (.)
PRIMARY = 108, // true, false, null, this, super
PRIMARY = 108, // true, false, null, this
FUNCTION = 109, // function keyword
EXPORT = 110, // export keyword
IMPORT = 111, // import keyword

Просмотреть файл

@ -688,8 +688,9 @@ class Parser {
tt = ts.peekTokenSameLine();
ts.flags &= ~ts.TSF_REGEXP;
if (tt != ts.EOF && tt != ts.EOL
&& tt != ts.SEMI && tt != ts.RC) {
if (tt != ts.EOF && tt != ts.EOL && tt != ts.SEMI &&
tt != ts.RC && !(tt == ts.PRIMARY && ts.getOp() == ts.THIS))
{
lineno = ts.getLineno();
retExpr = expr(ts, source, false);
if (ts.getLineno() == lineno)

Просмотреть файл

@ -195,7 +195,7 @@ public class TokenStream {
INC = 105, // increment/decrement (++ --)
DEC = 106,
DOT = 107, // member operator (.)
PRIMARY = 108, // true, false, null, this, super
PRIMARY = 108, // true, false, null, this
FUNCTION = 109, // function keyword
EXPORT = 110, // export keyword
IMPORT = 111, // import keyword