mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 23:27:30 +09:00
Inline GeneratorKindFromPropertyType and AsyncKindFromPropertyType.
Trivially inlines these into their sole caller.
This commit is contained in:
parent
da1cb60dc3
commit
092b87b756
1 changed files with 9 additions and 20 deletions
|
|
@ -6578,24 +6578,6 @@ JSOpFromPropertyType(PropertyType propType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GeneratorKind
|
|
||||||
GeneratorKindFromPropertyType(PropertyType propType)
|
|
||||||
{
|
|
||||||
if (propType == PropertyType::GeneratorMethod)
|
|
||||||
return StarGenerator;
|
|
||||||
if (propType == PropertyType::AsyncMethod)
|
|
||||||
return StarGenerator;
|
|
||||||
return NotGenerator;
|
|
||||||
}
|
|
||||||
|
|
||||||
static FunctionAsyncKind
|
|
||||||
AsyncKindFromPropertyType(PropertyType propType)
|
|
||||||
{
|
|
||||||
if (propType == PropertyType::AsyncMethod)
|
|
||||||
return AsyncFunction;
|
|
||||||
return SyncFunction;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename ParseHandler>
|
template <typename ParseHandler>
|
||||||
typename ParseHandler::Node
|
typename ParseHandler::Node
|
||||||
Parser<ParseHandler>::classDefinition(YieldHandling yieldHandling,
|
Parser<ParseHandler>::classDefinition(YieldHandling yieldHandling,
|
||||||
|
|
@ -9437,8 +9419,15 @@ Parser<ParseHandler>::methodDefinition(uint32_t preludeStart, PropertyType propT
|
||||||
MOZ_CRASH("Parser: methodDefinition: unexpected property type");
|
MOZ_CRASH("Parser: methodDefinition: unexpected property type");
|
||||||
}
|
}
|
||||||
|
|
||||||
GeneratorKind generatorKind = GeneratorKindFromPropertyType(propType);
|
GeneratorKind generatorKind = (propType == PropertyType::GeneratorMethod ||
|
||||||
FunctionAsyncKind asyncKind = AsyncKindFromPropertyType(propType);
|
propType == PropertyType::AsyncMethod)
|
||||||
|
? StarGenerator
|
||||||
|
: NotGenerator;
|
||||||
|
|
||||||
|
FunctionAsyncKind asyncKind = (propType == PropertyType::AsyncMethod)
|
||||||
|
? AsyncFunction
|
||||||
|
: SyncFunction;
|
||||||
|
|
||||||
YieldHandling yieldHandling = GetYieldHandling(generatorKind, asyncKind);
|
YieldHandling yieldHandling = GetYieldHandling(generatorKind, asyncKind);
|
||||||
|
|
||||||
Node pn = handler.newFunctionExpression();
|
Node pn = handler.newFunctionExpression();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue