From 239003468d0617ca34b5e78627f014207b4e63ee Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 6 Apr 2019 06:26:49 +0200 Subject: Inline GeneratorKindFromPropertyType and AsyncKindFromPropertyType. Trivially inlines these into their sole caller. --- js/src/frontend/Parser.cpp | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'js/src') diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index c34e4d563..5a42b75b0 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -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::Node Parser::classDefinition(YieldHandling yieldHandling, @@ -9437,8 +9419,15 @@ Parser::methodDefinition(uint32_t preludeStart, PropertyType propT MOZ_CRASH("Parser: methodDefinition: unexpected property type"); } - GeneratorKind generatorKind = GeneratorKindFromPropertyType(propType); - FunctionAsyncKind asyncKind = AsyncKindFromPropertyType(propType); + GeneratorKind generatorKind = (propType == PropertyType::GeneratorMethod || + propType == PropertyType::AsyncMethod) + ? StarGenerator + : NotGenerator; + + FunctionAsyncKind asyncKind = (propType == PropertyType::AsyncMethod) + ? AsyncFunction + : SyncFunction; + YieldHandling yieldHandling = GetYieldHandling(generatorKind, asyncKind); Node pn = handler.newFunctionExpression(); -- cgit v1.2.3