Bug 1424946 - Move GeneralParser::declareFunctionThis into a baser class. r=arai

This commit is contained in:
Jeff Walden 2017-12-12 15:20:58 -06:00
parent 8f7b11ac56
commit 811d1f7fd6
2 changed files with 5 additions and 3 deletions

View File

@ -2300,9 +2300,9 @@ ParserBase::hasUsedFunctionSpecialName(HandlePropertyName name)
return hasUsedName(name) || pc->functionBox()->bindingsAccessedDynamically();
}
template <class ParseHandler, typename CharT>
template <class ParseHandler>
bool
GeneralParser<ParseHandler, CharT>::declareFunctionThis()
PerHandlerParser<ParseHandler>::declareFunctionThis()
{
// The asm.js validator does all its own symbol-table management so, as an
// optimization, avoid doing any work here.

View File

@ -308,6 +308,8 @@ class PerHandlerParser
// Required on Scope exit.
bool propagateFreeNamesAndMarkClosedOverBindings(ParseContext::Scope& scope);
bool declareFunctionThis();
public:
bool isValidSimpleAssignmentTarget(Node node,
FunctionCallBehavior behavior = ForbidAssignmentToFunctionCalls);
@ -388,6 +390,7 @@ class GeneralParser
using Base::usedNames;
private:
using Base::declareFunctionThis;
using Base::hasUsedName;
using Base::noteDestructuredPositionalFormalParameter;
using Base::noteUsedName;
@ -869,7 +872,6 @@ class GeneralParser
bool matchInOrOf(bool* isForInp, bool* isForOfp);
bool declareFunctionArgumentsObject();
bool declareFunctionThis();
Node newInternalDotName(HandlePropertyName name);
Node newThisName();
Node newDotGeneratorName();