fix case for anonymous functions.

git-svn-id: svn://10.0.0.236/trunk@58384 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
beard%netscape.com
2000-01-22 03:28:04 +00:00
parent f37b468c2f
commit e36ce06075
2 changed files with 10 additions and 4 deletions

View File

@@ -510,10 +510,13 @@ public class NodeTransformer {
if (nodeType == TokenStream.FUNCTION) {
// In a function with both "var x" and "function x",
// disregard the var statement, independent of order.
vars.removeLocal(node.getString());
String functionName = node.getString();
if (functionName == null)
continue;
vars.removeLocal(functionName);
if (ht == null)
ht = new Hashtable();
ht.put(node.getString(), Boolean.TRUE);
ht.put(functionName, Boolean.TRUE);
}
if (nodeType != TokenStream.VAR)
continue;

View File

@@ -510,10 +510,13 @@ public class NodeTransformer {
if (nodeType == TokenStream.FUNCTION) {
// In a function with both "var x" and "function x",
// disregard the var statement, independent of order.
vars.removeLocal(node.getString());
String functionName = node.getString();
if (functionName == null)
continue;
vars.removeLocal(functionName);
if (ht == null)
ht = new Hashtable();
ht.put(node.getString(), Boolean.TRUE);
ht.put(functionName, Boolean.TRUE);
}
if (nodeType != TokenStream.VAR)
continue;