summaryrefslogtreecommitdiffstats
path: root/js/src/frontend/Parser.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-19 14:48:24 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-19 14:48:24 +0100
commit75db97cb3772fc0693947ec17c5954a04cb234a8 (patch)
treedc1035d6da831d7cedda70f770f1f17a2272ed37 /js/src/frontend/Parser.cpp
parentfaa5f0df26e09d1f2e633618476294d112c24322 (diff)
downloadUXP-75db97cb3772fc0693947ec17c5954a04cb234a8.tar
UXP-75db97cb3772fc0693947ec17c5954a04cb234a8.tar.gz
UXP-75db97cb3772fc0693947ec17c5954a04cb234a8.tar.lz
UXP-75db97cb3772fc0693947ec17c5954a04cb234a8.tar.xz
UXP-75db97cb3772fc0693947ec17c5954a04cb234a8.zip
Bug 1320388: Move JSFunction::HAS_REST to JSScript and LazyScript
Issue #78 [Depends on] Bug 883377: Implement ES6 function "name" property semantics
Diffstat (limited to 'js/src/frontend/Parser.cpp')
-rw-r--r--js/src/frontend/Parser.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
index f42546eb5..78e47ceb3 100644
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -465,6 +465,7 @@ FunctionBox::FunctionBox(ExclusiveContext* cx, LifoAlloc& alloc, ObjectBox* trac
usesApply(false),
usesThis(false),
usesReturn(false),
+ hasRest_(false),
funCxFlags()
{
// Functions created at parse time may be set singleton after parsing and
@@ -477,7 +478,6 @@ void
FunctionBox::initFromLazyFunction()
{
JSFunction* fun = function();
- length = fun->nargs() - fun->hasRest();
if (fun->lazyScript()->isDerivedClassConstructor())
setDerivedClassConstructor();
if (fun->lazyScript()->needsHomeObject())
@@ -492,8 +492,6 @@ FunctionBox::initStandaloneFunction(Scope* enclosingScope)
// Standalone functions are Function or Generator constructors and are
// always scoped to the global.
MOZ_ASSERT(enclosingScope->is<GlobalScope>());
- JSFunction* fun = function();
- length = fun->nargs() - fun->hasRest();
enclosingScope_ = enclosingScope;
allowNewTarget_ = true;
thisBinding_ = ThisBinding::Function;
@@ -2214,6 +2212,8 @@ Parser<SyntaxParseHandler>::finishFunction()
lazy->setStrict();
lazy->setGeneratorKind(funbox->generatorKind());
lazy->setAsyncKind(funbox->asyncKind());
+ if (funbox->hasRest())
+ lazy->setHasRest();
if (funbox->isLikelyConstructorWrapper())
lazy->setLikelyConstructorWrapper();
if (funbox->isDerivedClassConstructor())
@@ -2757,7 +2757,7 @@ Parser<ParseHandler>::functionArguments(YieldHandling yieldHandling, FunctionSyn
}
hasRest = true;
- funbox->function()->setHasRest();
+ funbox->setHasRest();
if (!tokenStream.getToken(&tt))
return false;