Skip to content

Commit

Permalink
fix undefined variable diagnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
NotFound committed Nov 19, 2011
1 parent 0942ce4 commit 48c2099
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions winxedst1.winxed
Expand Up @@ -205,9 +205,9 @@ function ExpectKeyword(string name, var tk)
RequireKeyword(name, t);
}

function UndefinedVariable(name)
function UndefinedVariable(string name, var t)
{
SyntaxError("Variable '" + string(name) + "' is not defined", name);
SyntaxError("Variable '" + name + "' is not defined", t);
}

//*********************************************
Expand Down Expand Up @@ -3587,7 +3587,7 @@ class IdentifierExpr : SimpleExpr
{
var value = self.checkIdentifier();
if (value == '')
UndefinedVariable(self);
UndefinedVariable(self.name, self);
return value;
}
function optimize()
Expand Down Expand Up @@ -8359,7 +8359,7 @@ class ForeachStatement : LoopStatement, BlockStatement

var itvar = self.getvar(self.varname);
if (itvar == null)
UndefinedVariable(self.varname);
UndefinedVariable(self.varname, self);

string iterator = self.createreg(REGvar);
string continuelabel = self.gencontinuelabel();
Expand Down

0 comments on commit 48c2099

Please sign in to comment.