summaryrefslogtreecommitdiffstats
path: root/js/src
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-04-06 06:26:49 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-04-06 06:26:49 +0200
commit239003468d0617ca34b5e78627f014207b4e63ee (patch)
treee393258d67a3ae00225c3c992dacb612000cd1ae /js/src
parent7333618581b018ca73c3482e2d5547765f6c3a1d (diff)
downloadUXP-239003468d0617ca34b5e78627f014207b4e63ee.tar
UXP-239003468d0617ca34b5e78627f014207b4e63ee.tar.gz
UXP-239003468d0617ca34b5e78627f014207b4e63ee.tar.lz
UXP-239003468d0617ca34b5e78627f014207b4e63ee.tar.xz
UXP-239003468d0617ca34b5e78627f014207b4e63ee.zip
Inline GeneratorKindFromPropertyType and AsyncKindFromPropertyType.
Trivially inlines these into their sole caller.
Diffstat (limited to 'js/src')
-rw-r--r--js/src/frontend/Parser.cpp29
1 files changed, 9 insertions, 20 deletions
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>
typename ParseHandler::Node
Parser<ParseHandler>::classDefinition(YieldHandling yieldHandling,
@@ -9437,8 +9419,15 @@ Parser<ParseHandler>::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();