mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
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:
parent
a70c59fa3a
commit
cae5f15434
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user