зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1424946
- Move GeneralParser::newFunctionBox into a baser class. r=arai
This commit is contained in:
Родитель
ea7bcff5e6
Коммит
96aa0c5462
|
@ -923,13 +923,12 @@ ParserBase::newObjectBox(JSObject* obj)
|
|||
return objbox;
|
||||
}
|
||||
|
||||
template <class ParseHandler, typename CharT>
|
||||
template <class ParseHandler>
|
||||
FunctionBox*
|
||||
GeneralParser<ParseHandler, CharT>::newFunctionBox(Node fn, JSFunction* fun,
|
||||
uint32_t toStringStart,
|
||||
Directives inheritedDirectives,
|
||||
GeneratorKind generatorKind,
|
||||
FunctionAsyncKind asyncKind)
|
||||
PerHandlerParser<ParseHandler>::newFunctionBox(Node fn, JSFunction* fun, uint32_t toStringStart,
|
||||
Directives inheritedDirectives,
|
||||
GeneratorKind generatorKind,
|
||||
FunctionAsyncKind asyncKind)
|
||||
{
|
||||
MOZ_ASSERT(fun);
|
||||
|
||||
|
@ -941,9 +940,8 @@ GeneralParser<ParseHandler, CharT>::newFunctionBox(Node fn, JSFunction* fun,
|
|||
* function.
|
||||
*/
|
||||
FunctionBox* funbox =
|
||||
alloc.template new_<FunctionBox>(context, traceListHead, fun, toStringStart,
|
||||
inheritedDirectives, options().extraWarningsOption,
|
||||
generatorKind, asyncKind);
|
||||
alloc.new_<FunctionBox>(context, traceListHead, fun, toStringStart, inheritedDirectives,
|
||||
options().extraWarningsOption, generatorKind, asyncKind);
|
||||
if (!funbox) {
|
||||
ReportOutOfMemory(context);
|
||||
return nullptr;
|
||||
|
|
|
@ -286,7 +286,9 @@ class PerHandlerParser
|
|||
bool isValidSimpleAssignmentTarget(Node node,
|
||||
FunctionCallBehavior behavior = ForbidAssignmentToFunctionCalls);
|
||||
|
||||
|
||||
FunctionBox* newFunctionBox(Node fn, JSFunction* fun, uint32_t toStringStart,
|
||||
Directives directives, GeneratorKind generatorKind,
|
||||
FunctionAsyncKind asyncKind);
|
||||
};
|
||||
|
||||
enum class ExpressionClosure { Allowed, Forbidden };
|
||||
|
@ -343,6 +345,7 @@ class GeneralParser
|
|||
using Base::keepAtoms;
|
||||
using Base::nameIsArgumentsOrEval;
|
||||
using Base::newFunction;
|
||||
using Base::newFunctionBox;
|
||||
using Base::options;
|
||||
using Base::pos;
|
||||
using Base::setLocalStrictMode;
|
||||
|
@ -527,10 +530,6 @@ class GeneralParser
|
|||
*/
|
||||
Node parse();
|
||||
|
||||
FunctionBox* newFunctionBox(Node fn, JSFunction* fun, uint32_t toStringStart,
|
||||
Directives directives,
|
||||
GeneratorKind generatorKind, FunctionAsyncKind asyncKind);
|
||||
|
||||
void trace(JSTracer* trc);
|
||||
|
||||
/* Report the given error at the current offset. */
|
||||
|
|
Загрузка…
Ссылка в новой задаче