Removal of package-private setter methods in FunctionNode in favor of package-private (not private) fields: that just was just adding unnecessary code bloat.

This commit is contained in:
igor%mir2.org 2004-09-10 17:54:13 +00:00
parent a70c59fa3a
commit cae5f15434
2 changed files with 7 additions and 19 deletions

View File

@ -53,18 +53,10 @@ public class FunctionNode extends ScriptOrFnNode {
return itsNeedsActivation;
}
void setRequiresActivation() {
itsNeedsActivation = true;
}
public boolean getIgnoreDynamicScope() {
return itsIgnoreDynamicScope;
}
void setIgnoreDynamicScope() {
itsIgnoreDynamicScope = true;
}
/**
* There are three types of functions that can be defined. The first
* is a function statement. This is a function appearing as a top-level
@ -88,12 +80,8 @@ public class FunctionNode extends ScriptOrFnNode {
return itsFunctionType;
}
void setFunctionType(int functionType) {
itsFunctionType = functionType;
}
private String functionName;
private boolean itsNeedsActivation;
private int itsFunctionType;
private boolean itsIgnoreDynamicScope;
String functionName;
boolean itsNeedsActivation;
int itsFunctionType;
boolean itsIgnoreDynamicScope;
}

View File

@ -394,13 +394,13 @@ final class IRFactory
Node initFunction(FunctionNode fnNode, int functionIndex,
Node statements, int functionType)
{
fnNode.setFunctionType(functionType);
fnNode.itsFunctionType = functionType;
fnNode.addChildToBack(statements);
int functionCount = fnNode.getFunctionCount();
if (functionCount != 0) {
// Functions containing other functions require activation objects
fnNode.setRequiresActivation();
fnNode.itsNeedsActivation = true;
for (int i = 0; i != functionCount; ++i) {
FunctionNode fn = fnNode.getFunctionNode(i);
// nested function expression statements overrides var
@ -1422,7 +1422,7 @@ final class IRFactory
private void setRequiresActivation()
{
if (parser.insideFunction()) {
((FunctionNode)parser.currentScriptOrFn).setRequiresActivation();
((FunctionNode)parser.currentScriptOrFn).itsNeedsActivation = true;
}
}