summaryrefslogtreecommitdiff
path: root/js/src/frontend/ParseNode.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-05-21 16:38:37 +0000
committerMoonchild <moonchild@palemoon.org>2022-05-21 16:38:37 +0000
commit2694995e52a0bd767acac74f2306767d0a3720c9 (patch)
treed2a1198ccd0b8eab1b0b589b6900845aa3b87d5b /js/src/frontend/ParseNode.h
parentf532bbd7af98d2cb543bf86b93b0e0e9fa1e9b2a (diff)
parent00c51f75fa4845f348708a796d552ca281f8210a (diff)
downloaduxp-2694995e52a0bd767acac74f2306767d0a3720c9.tar.gz
Merge branch 'master' into 12101210
Diffstat (limited to 'js/src/frontend/ParseNode.h')
-rw-r--r--js/src/frontend/ParseNode.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h
index 0ad0fe0885..377eb999d9 100644
--- a/js/src/frontend/ParseNode.h
+++ b/js/src/frontend/ParseNode.h
@@ -130,8 +130,12 @@ class ObjectBox;
\
/* \
* Binary operators. \
- * These must be in the same order as TOK_OR and friends in TokenStream.h. \
+ * These must be in the same order in several places: \
+ * - the precedence table and JSOp code list in Parser.cpp \
+ * - the binary operators in TokenKind.h \
+ * - the first and last binary operator markers in ParseNode.h \
*/ \
+ F(COALESCE) \
F(OR) \
F(AND) \
F(BITOR) \
@@ -189,7 +193,13 @@ enum ParseNodeKind
FOR_EACH_PARSE_NODE_KIND(EMIT_ENUM)
#undef EMIT_ENUM
PNK_LIMIT, /* domain size */
- PNK_BINOP_FIRST = PNK_OR,
+ /*
+ * Binary operator markers.
+ * These must be in the same order in several places:
+ * - the precedence table and JSOp code list in Parser.cpp
+ * - the binary operators in ParseNode.h and TokenKind.h
+ */
+ PNK_BINOP_FIRST = PNK_COALESCE,
PNK_BINOP_LAST = PNK_POW,
PNK_ASSIGNMENT_START = PNK_ASSIGN,
PNK_ASSIGNMENT_LAST = PNK_POWASSIGN
@@ -329,8 +339,9 @@ IsTypeofKind(ParseNodeKind kind)
* PNK_POWASSIGN
* PNK_CONDITIONAL ternary (cond ? trueExpr : falseExpr)
* pn_kid1: cond, pn_kid2: then, pn_kid3: else
- * PNK_OR, list pn_head; list of pn_count subexpressions
- * PNK_AND, All of these operators are left-associative except (**).
+ * PNK_COALESCE, list pn_head; list of pn_count subexpressions
+ * PNK_OR, All of these operators are left-associative except (**).
+ * PNK_AND
* PNK_BITOR,
* PNK_BITXOR,
* PNK_BITAND,