Changes to get traditional functions with args. working
git-svn-id: svn://10.0.0.236/trunk@35302 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -13,12 +13,26 @@ class JSName extends ExpressionNode {
|
||||
|
||||
JSReference evalLHS(Environment theEnv)
|
||||
{
|
||||
return new JSReference(theEnv.scope, id);
|
||||
JSScope scope = theEnv.scope;
|
||||
while (scope != null) {
|
||||
if (scope.hasProp(theEnv, id))
|
||||
return new JSReference(scope, id);
|
||||
else
|
||||
scope = scope.parent;
|
||||
}
|
||||
return new JSReference(theEnv.globalScope, id);
|
||||
}
|
||||
|
||||
JSValue eval(Environment theEnv)
|
||||
{
|
||||
return theEnv.scope.getProp(theEnv, id);
|
||||
JSScope scope = theEnv.scope;
|
||||
while (scope != null) {
|
||||
if (scope.hasProp(theEnv, id))
|
||||
return scope.getProp(theEnv, id);
|
||||
else
|
||||
scope = scope.parent;
|
||||
}
|
||||
throw new JSException(new JSString(id.s + " undefined"));
|
||||
}
|
||||
|
||||
JSIdentifier id;
|
||||
|
||||
Reference in New Issue
Block a user