summaryrefslogtreecommitdiffstats
path: root/js/src/frontend/Parser.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-12-13 21:29:23 -0500
committerGaming4JC <g4jc@hyperbola.info>2019-12-17 06:25:27 -0500
commitd5086ac3aa308bb1ef177834366eeaf7b39bb17e (patch)
tree9b2c84158cf996b388bcb191130a5062fd7d6992 /js/src/frontend/Parser.cpp
parent82f9efff935a4ac4379bdfddddc84aae84fc869e (diff)
downloadUXP-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.tar
UXP-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.tar.gz
UXP-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.tar.lz
UXP-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.tar.xz
UXP-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.zip
Bug 1331092 - Part 2: Implement Async Generator except yield*.
Tag #1287
Diffstat (limited to 'js/src/frontend/Parser.cpp')
-rw-r--r--js/src/frontend/Parser.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
index 3ae5890ac..7704cf65a 100644
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -3785,10 +3785,12 @@ Parser<ParseHandler>::functionStmt(uint32_t toStringStart, YieldHandling yieldHa
GeneratorKind generatorKind = NotGenerator;
if (tt == TOK_MUL) {
+#ifdef RELEASE_OR_BETA
if (asyncKind != SyncFunction) {
error(JSMSG_ASYNC_GENERATOR);
return null();
}
+#endif
generatorKind = StarGenerator;
if (!tokenStream.getToken(&tt))
return null();
@@ -3857,10 +3859,12 @@ Parser<ParseHandler>::functionExpr(uint32_t toStringStart, InvokedPrediction inv
return null();
if (tt == TOK_MUL) {
+#ifdef RELEASE_OR_BETA
if (asyncKind != SyncFunction) {
error(JSMSG_ASYNC_GENERATOR);
return null();
}
+#endif
generatorKind = StarGenerator;
if (!tokenStream.getToken(&tt))
return null();
@@ -9468,11 +9472,6 @@ Parser<ParseHandler>::propertyName(YieldHandling yieldHandling,
bool isGenerator = false;
bool isAsync = false;
- if (ltok == TOK_MUL) {
- isGenerator = true;
- if (!tokenStream.getToken(&ltok))
- return null();
- }
if (ltok == TOK_ASYNC) {
// AsyncMethod[Yield, Await]:
@@ -9500,9 +9499,16 @@ Parser<ParseHandler>::propertyName(YieldHandling yieldHandling,
}
}
- if (isAsync && isGenerator) {
- error(JSMSG_ASYNC_GENERATOR);
- return null();
+ if (ltok == TOK_MUL) {
+#ifdef RELEASE_OR_BETA
+ if (isAsync) {
+ error(JSMSG_ASYNC_GENERATOR);
+ return null();
+ }
+#endif
+ isGenerator = true;
+ if (!tokenStream.getToken(&ltok))
+ return null();
}
propAtom.set(nullptr);