Bug 1505343 - Part 3: Rename Bin{Kind,Field,Variant} to BinAST{Kind,Field,Variant}. r=Yoric
☠☠ backed out by 7cbe3fbc4b7f ☠ ☠
authorTooru Fujisawa <arai_a@mac.com>
Wed, 13 Mar 2019 02:46:51 +0000
changeset 521647 4ac13d1f0d7c331ca5e0a27bcf2ef73fd7bf8ed8
parent 521646 b2456f6d11c4f3a9e02f601e16a3c8b80ae4aaa5
child 521648 5a255779e2a73972472450a89e2c87d055b88870
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric
bugs1505343
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1505343 - Part 3: Rename Bin{Kind,Field,Variant} to BinAST{Kind,Field,Variant}. r=Yoric Differential Revision: https://phabricator.services.mozilla.com/D23099
js/src/frontend/BinAST.yaml
js/src/frontend/BinASTParser.cpp
js/src/frontend/BinASTParser.h
js/src/frontend/BinASTParserPerTokenizer.cpp
js/src/frontend/BinASTParserPerTokenizer.h
js/src/frontend/BinASTRuntimeSupport.cpp
js/src/frontend/BinASTRuntimeSupport.h
js/src/frontend/BinASTToken.cpp
js/src/frontend/BinASTToken.h
js/src/frontend/BinASTTokenReaderBase.cpp
js/src/frontend/BinASTTokenReaderBase.h
js/src/frontend/BinASTTokenReaderMultipart.cpp
js/src/frontend/BinASTTokenReaderMultipart.h
js/src/frontend/binast/src/main.rs
js/src/vm/JSScript.cpp
--- a/js/src/frontend/BinAST.yaml
+++ b/js/src/frontend/BinAST.yaml
@@ -106,17 +106,17 @@ hpp:
 
       template<typename Tok>
       class BinASTParser : public BinASTParserPerTokenizer<Tok> {
        public:
         using Base = BinASTParserPerTokenizer<Tok>;
 
         using Tokenizer = Tok;
 
-        using BinFields = typename Tokenizer::BinFields;
+        using BinASTFields = typename Tokenizer::BinASTFields;
         using AutoList = typename Tokenizer::AutoList;
         using AutoTaggedTuple = typename Tokenizer::AutoTaggedTuple;
         using Chars = typename Tokenizer::Chars;
 
        public:
         // Auto-generated types.
         using AssertedDeclaredKind = binast::AssertedDeclaredKind;
         using BinaryOperator = binast::BinaryOperator;
@@ -294,19 +294,19 @@ hpp:
 
       #include <stddef.h>
 
       /**
        * Definition of Binary AST tokens.
        *
        * In the Binary AST world, an AST is composed of nodes, where a node is
        * defined by:
-       * - a Kind (see `BinKind`);
+       * - a Kind (see `BinASTKind`);
        * - a list of fields, where each field is:
-       *    - a Name (see `BinField`);
+       *    - a Name (see `BinASTField`);
        *    - a Value, which may be either a node or a primitive value.
        *
        * The mapping between Kind and list of fields is determined entirely by
        * the grammar of Binary AST. The mapping between (Kind, Name) and the
        * structure of Value is also determined entirely by the grammar of
        * Binary AST.
        *
        * As per the specifications of Binary AST, kinds may be added as the
@@ -320,29 +320,29 @@ hpp:
        * unknown Kinds or Names.
        */
 
       namespace js {
       namespace frontend {
     footer: |
 
       /**
-       * Return a string describing a `BinKind`.
+       * Return a string describing a `BinASTKind`.
        */
-      const char* describeBinKind(const BinKind& kind);
+      const char* describeBinASTKind(const BinASTKind& kind);
 
       /**
-       * Return a string describing a `BinField`.
+       * Return a string describing a `BinASTField`.
        */
-      const char* describeBinField(const BinField& kind);
+      const char* describeBinASTField(const BinASTField& kind);
 
       /**
-       * Return a string describing a `BinVariant`.
+       * Return a string describing a `BinASTVariant`.
        */
-      const char* describeBinVariant(const BinVariant& kind);
+      const char* describeBinASTVariant(const BinASTVariant& kind);
 
       } // namespace frontend
       } // namespace js
 
       #endif // frontend_BinASTToken_h
 
 Arguments:
   init: |
@@ -1610,17 +1610,17 @@ VariableDeclarator:
       } else {
         result = bindingNameNode;
       }
     } else {
       // `var pattern = bar`
       if (!init) {
         // Here, `init` is required.
         return raiseMissingField("VariableDeclarator (with non-trivial pattern)",
-                                 BinField::Init);
+                                 BinASTField::Init);
       }
 
       MOZ_CRASH("Unimplemented: AssertedScope check for BindingPattern variable declaration");
       BINJS_TRY_VAR(result,
                     handler_.newAssignment(ParseNodeKind::AssignExpr, binding,
                                            init));
     }
 
--- a/js/src/frontend/BinASTParser.cpp
+++ b/js/src/frontend/BinASTParser.cpp
@@ -45,48 +45,48 @@ bool operator==(const typename Tok::Char
 AssertedMaybePositionalParameterName ::= AssertedParameterName
     AssertedPositionalParameterName
     AssertedRestParameterName
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedMaybePositionalParameterName(
     AssertedScopeKind scopeKind,
     MutableHandle<GCVector<JSAtom*>> positionalParams) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result,
                      parseSumAssertedMaybePositionalParameterName(
                          start, kind, fields, scopeKind, positionalParams));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseSumAssertedMaybePositionalParameterName(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     AssertedScopeKind scopeKind,
     MutableHandle<GCVector<JSAtom*>> positionalParams) {
   Ok result;
   switch (kind) {
-    case BinKind::AssertedParameterName:
+    case BinASTKind::AssertedParameterName:
       return raiseError(
           "FIXME: Not implemented yet in this preview release "
           "(AssertedParameterName)");
-    case BinKind::AssertedPositionalParameterName:
+    case BinASTKind::AssertedPositionalParameterName:
       MOZ_TRY_VAR(result,
                   parseInterfaceAssertedPositionalParameterName(
                       start, kind, fields, scopeKind, positionalParams));
       break;
-    case BinKind::AssertedRestParameterName:
+    case BinASTKind::AssertedRestParameterName:
       return raiseError(
           "FIXME: Not implemented yet in this preview release "
           "(AssertedRestParameterName)");
     default:
       return raiseInvalidKind("AssertedMaybePositionalParameterName", kind);
   }
   return result;
 }
@@ -95,92 +95,92 @@ JS::Result<Ok> BinASTParser<Tok>::parseS
 AssignmentTarget ::= ArrayAssignmentTarget
     AssignmentTargetIdentifier
     ComputedMemberAssignmentTarget
     ObjectAssignmentTarget
     StaticMemberAssignmentTarget
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseAssignmentTarget() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumAssignmentTarget(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumAssignmentTarget(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayAssignmentTarget:
+    case BinASTKind::ArrayAssignmentTarget:
       MOZ_TRY_VAR(result,
                   parseInterfaceArrayAssignmentTarget(start, kind, fields));
       break;
-    case BinKind::AssignmentTargetIdentifier:
+    case BinASTKind::AssignmentTargetIdentifier:
       MOZ_TRY_VAR(result, parseInterfaceAssignmentTargetIdentifier(start, kind,
                                                                    fields));
       break;
-    case BinKind::ComputedMemberAssignmentTarget:
+    case BinASTKind::ComputedMemberAssignmentTarget:
       MOZ_TRY_VAR(result, parseInterfaceComputedMemberAssignmentTarget(
                               start, kind, fields));
       break;
-    case BinKind::ObjectAssignmentTarget:
+    case BinASTKind::ObjectAssignmentTarget:
       MOZ_TRY_VAR(result,
                   parseInterfaceObjectAssignmentTarget(start, kind, fields));
       break;
-    case BinKind::StaticMemberAssignmentTarget:
+    case BinASTKind::StaticMemberAssignmentTarget:
       MOZ_TRY_VAR(result, parseInterfaceStaticMemberAssignmentTarget(
                               start, kind, fields));
       break;
     default:
       return raiseInvalidKind("AssignmentTarget", kind);
   }
   return result;
 }
 
 /*
 Binding ::= ArrayBinding
     BindingIdentifier
     ObjectBinding
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseBinding() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumBinding(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumBinding(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayBinding:
+    case BinASTKind::ArrayBinding:
       MOZ_TRY_VAR(result, parseInterfaceArrayBinding(start, kind, fields));
       break;
-    case BinKind::BindingIdentifier:
+    case BinASTKind::BindingIdentifier:
       MOZ_TRY_VAR(result, parseInterfaceBindingIdentifier(start, kind, fields));
       break;
-    case BinKind::ObjectBinding:
+    case BinASTKind::ObjectBinding:
       MOZ_TRY_VAR(result, parseInterfaceObjectBinding(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("Binding", kind);
   }
   return result;
 }
 
@@ -215,148 +215,148 @@ Expression ::= ArrayExpression
     ThisExpression
     UnaryExpression
     UpdateExpression
     YieldExpression
     YieldStarExpression
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseExpression() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumExpression(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayExpression:
+    case BinASTKind::ArrayExpression:
       MOZ_TRY_VAR(result, parseInterfaceArrayExpression(start, kind, fields));
       break;
-    case BinKind::AssignmentExpression:
+    case BinASTKind::AssignmentExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceAssignmentExpression(start, kind, fields));
       break;
-    case BinKind::AwaitExpression:
+    case BinASTKind::AwaitExpression:
       MOZ_TRY_VAR(result, parseInterfaceAwaitExpression(start, kind, fields));
       break;
-    case BinKind::BinaryExpression:
+    case BinASTKind::BinaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceBinaryExpression(start, kind, fields));
       break;
-    case BinKind::CallExpression:
+    case BinASTKind::CallExpression:
       MOZ_TRY_VAR(result, parseInterfaceCallExpression(start, kind, fields));
       break;
-    case BinKind::ClassExpression:
+    case BinASTKind::ClassExpression:
       MOZ_TRY_VAR(result, parseInterfaceClassExpression(start, kind, fields));
       break;
-    case BinKind::CompoundAssignmentExpression:
+    case BinASTKind::CompoundAssignmentExpression:
       MOZ_TRY_VAR(result, parseInterfaceCompoundAssignmentExpression(
                               start, kind, fields));
       break;
-    case BinKind::ComputedMemberExpression:
+    case BinASTKind::ComputedMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceComputedMemberExpression(start, kind, fields));
       break;
-    case BinKind::ConditionalExpression:
+    case BinASTKind::ConditionalExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceConditionalExpression(start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithExpression:
+    case BinASTKind::EagerArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithFunctionBody:
+    case BinASTKind::EagerArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::EagerFunctionExpression:
+    case BinASTKind::EagerFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceEagerFunctionExpression(start, kind, fields));
       break;
-    case BinKind::IdentifierExpression:
+    case BinASTKind::IdentifierExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceIdentifierExpression(start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithExpression:
+    case BinASTKind::LazyArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithFunctionBody:
+    case BinASTKind::LazyArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::LazyFunctionExpression:
+    case BinASTKind::LazyFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLazyFunctionExpression(start, kind, fields));
       break;
-    case BinKind::LiteralBooleanExpression:
+    case BinASTKind::LiteralBooleanExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralBooleanExpression(start, kind, fields));
       break;
-    case BinKind::LiteralInfinityExpression:
+    case BinASTKind::LiteralInfinityExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralInfinityExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNullExpression:
+    case BinASTKind::LiteralNullExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNullExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNumericExpression:
+    case BinASTKind::LiteralNumericExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNumericExpression(start, kind, fields));
       break;
-    case BinKind::LiteralRegExpExpression:
+    case BinASTKind::LiteralRegExpExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralRegExpExpression(start, kind, fields));
       break;
-    case BinKind::LiteralStringExpression:
+    case BinASTKind::LiteralStringExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralStringExpression(start, kind, fields));
       break;
-    case BinKind::NewExpression:
+    case BinASTKind::NewExpression:
       MOZ_TRY_VAR(result, parseInterfaceNewExpression(start, kind, fields));
       break;
-    case BinKind::NewTargetExpression:
+    case BinASTKind::NewTargetExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceNewTargetExpression(start, kind, fields));
       break;
-    case BinKind::ObjectExpression:
+    case BinASTKind::ObjectExpression:
       MOZ_TRY_VAR(result, parseInterfaceObjectExpression(start, kind, fields));
       break;
-    case BinKind::StaticMemberExpression:
+    case BinASTKind::StaticMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceStaticMemberExpression(start, kind, fields));
       break;
-    case BinKind::TemplateExpression:
+    case BinASTKind::TemplateExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceTemplateExpression(start, kind, fields));
       break;
-    case BinKind::ThisExpression:
+    case BinASTKind::ThisExpression:
       MOZ_TRY_VAR(result, parseInterfaceThisExpression(start, kind, fields));
       break;
-    case BinKind::UnaryExpression:
+    case BinASTKind::UnaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceUnaryExpression(start, kind, fields));
       break;
-    case BinKind::UpdateExpression:
+    case BinASTKind::UpdateExpression:
       MOZ_TRY_VAR(result, parseInterfaceUpdateExpression(start, kind, fields));
       break;
-    case BinKind::YieldExpression:
+    case BinASTKind::YieldExpression:
       MOZ_TRY_VAR(result, parseInterfaceYieldExpression(start, kind, fields));
       break;
-    case BinKind::YieldStarExpression:
+    case BinASTKind::YieldStarExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceYieldStarExpression(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("Expression", kind);
   }
   return result;
 }
@@ -393,151 +393,151 @@ ExpressionOrSuper ::= ArrayExpression
     ThisExpression
     UnaryExpression
     UpdateExpression
     YieldExpression
     YieldStarExpression
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseExpressionOrSuper() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumExpressionOrSuper(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumExpressionOrSuper(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayExpression:
+    case BinASTKind::ArrayExpression:
       MOZ_TRY_VAR(result, parseInterfaceArrayExpression(start, kind, fields));
       break;
-    case BinKind::AssignmentExpression:
+    case BinASTKind::AssignmentExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceAssignmentExpression(start, kind, fields));
       break;
-    case BinKind::AwaitExpression:
+    case BinASTKind::AwaitExpression:
       MOZ_TRY_VAR(result, parseInterfaceAwaitExpression(start, kind, fields));
       break;
-    case BinKind::BinaryExpression:
+    case BinASTKind::BinaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceBinaryExpression(start, kind, fields));
       break;
-    case BinKind::CallExpression:
+    case BinASTKind::CallExpression:
       MOZ_TRY_VAR(result, parseInterfaceCallExpression(start, kind, fields));
       break;
-    case BinKind::ClassExpression:
+    case BinASTKind::ClassExpression:
       MOZ_TRY_VAR(result, parseInterfaceClassExpression(start, kind, fields));
       break;
-    case BinKind::CompoundAssignmentExpression:
+    case BinASTKind::CompoundAssignmentExpression:
       MOZ_TRY_VAR(result, parseInterfaceCompoundAssignmentExpression(
                               start, kind, fields));
       break;
-    case BinKind::ComputedMemberExpression:
+    case BinASTKind::ComputedMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceComputedMemberExpression(start, kind, fields));
       break;
-    case BinKind::ConditionalExpression:
+    case BinASTKind::ConditionalExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceConditionalExpression(start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithExpression:
+    case BinASTKind::EagerArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithFunctionBody:
+    case BinASTKind::EagerArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::EagerFunctionExpression:
+    case BinASTKind::EagerFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceEagerFunctionExpression(start, kind, fields));
       break;
-    case BinKind::IdentifierExpression:
+    case BinASTKind::IdentifierExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceIdentifierExpression(start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithExpression:
+    case BinASTKind::LazyArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithFunctionBody:
+    case BinASTKind::LazyArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::LazyFunctionExpression:
+    case BinASTKind::LazyFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLazyFunctionExpression(start, kind, fields));
       break;
-    case BinKind::LiteralBooleanExpression:
+    case BinASTKind::LiteralBooleanExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralBooleanExpression(start, kind, fields));
       break;
-    case BinKind::LiteralInfinityExpression:
+    case BinASTKind::LiteralInfinityExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralInfinityExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNullExpression:
+    case BinASTKind::LiteralNullExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNullExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNumericExpression:
+    case BinASTKind::LiteralNumericExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNumericExpression(start, kind, fields));
       break;
-    case BinKind::LiteralRegExpExpression:
+    case BinASTKind::LiteralRegExpExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralRegExpExpression(start, kind, fields));
       break;
-    case BinKind::LiteralStringExpression:
+    case BinASTKind::LiteralStringExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralStringExpression(start, kind, fields));
       break;
-    case BinKind::NewExpression:
+    case BinASTKind::NewExpression:
       MOZ_TRY_VAR(result, parseInterfaceNewExpression(start, kind, fields));
       break;
-    case BinKind::NewTargetExpression:
+    case BinASTKind::NewTargetExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceNewTargetExpression(start, kind, fields));
       break;
-    case BinKind::ObjectExpression:
+    case BinASTKind::ObjectExpression:
       MOZ_TRY_VAR(result, parseInterfaceObjectExpression(start, kind, fields));
       break;
-    case BinKind::StaticMemberExpression:
+    case BinASTKind::StaticMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceStaticMemberExpression(start, kind, fields));
       break;
-    case BinKind::Super:
+    case BinASTKind::Super:
       MOZ_TRY_VAR(result, parseInterfaceSuper(start, kind, fields));
       break;
-    case BinKind::TemplateExpression:
+    case BinASTKind::TemplateExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceTemplateExpression(start, kind, fields));
       break;
-    case BinKind::ThisExpression:
+    case BinASTKind::ThisExpression:
       MOZ_TRY_VAR(result, parseInterfaceThisExpression(start, kind, fields));
       break;
-    case BinKind::UnaryExpression:
+    case BinASTKind::UnaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceUnaryExpression(start, kind, fields));
       break;
-    case BinKind::UpdateExpression:
+    case BinASTKind::UpdateExpression:
       MOZ_TRY_VAR(result, parseInterfaceUpdateExpression(start, kind, fields));
       break;
-    case BinKind::YieldExpression:
+    case BinASTKind::YieldExpression:
       MOZ_TRY_VAR(result, parseInterfaceYieldExpression(start, kind, fields));
       break;
-    case BinKind::YieldStarExpression:
+    case BinASTKind::YieldStarExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceYieldStarExpression(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("ExpressionOrSuper", kind);
   }
   return result;
 }
@@ -548,56 +548,56 @@ ForInOfBindingOrAssignmentTarget ::= Arr
     ComputedMemberAssignmentTarget
     ForInOfBinding
     ObjectAssignmentTarget
     StaticMemberAssignmentTarget
 */
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseForInOfBindingOrAssignmentTarget() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(
       result, parseSumForInOfBindingOrAssignmentTarget(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseSumForInOfBindingOrAssignmentTarget(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayAssignmentTarget:
+    case BinASTKind::ArrayAssignmentTarget:
       MOZ_TRY_VAR(result,
                   parseInterfaceArrayAssignmentTarget(start, kind, fields));
       break;
-    case BinKind::AssignmentTargetIdentifier:
+    case BinASTKind::AssignmentTargetIdentifier:
       MOZ_TRY_VAR(result, parseInterfaceAssignmentTargetIdentifier(start, kind,
                                                                    fields));
       break;
-    case BinKind::ComputedMemberAssignmentTarget:
+    case BinASTKind::ComputedMemberAssignmentTarget:
       MOZ_TRY_VAR(result, parseInterfaceComputedMemberAssignmentTarget(
                               start, kind, fields));
       break;
-    case BinKind::ForInOfBinding:
+    case BinASTKind::ForInOfBinding:
       MOZ_TRY_VAR(result, parseInterfaceForInOfBinding(start, kind, fields));
       break;
-    case BinKind::ObjectAssignmentTarget:
+    case BinASTKind::ObjectAssignmentTarget:
       MOZ_TRY_VAR(result,
                   parseInterfaceObjectAssignmentTarget(start, kind, fields));
       break;
-    case BinKind::StaticMemberAssignmentTarget:
+    case BinASTKind::StaticMemberAssignmentTarget:
       MOZ_TRY_VAR(result, parseInterfaceStaticMemberAssignmentTarget(
                               start, kind, fields));
       break;
     default:
       return raiseInvalidKind("ForInOfBindingOrAssignmentTarget", kind);
   }
   return result;
 }
@@ -609,225 +609,225 @@ ObjectProperty ::= DataProperty
     EagerSetter
     LazyGetter
     LazyMethod
     LazySetter
     ShorthandProperty
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseObjectProperty() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumObjectProperty(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumObjectProperty(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::DataProperty:
+    case BinASTKind::DataProperty:
       MOZ_TRY_VAR(result, parseInterfaceDataProperty(start, kind, fields));
       break;
-    case BinKind::EagerGetter:
+    case BinASTKind::EagerGetter:
       MOZ_TRY_VAR(result, parseInterfaceEagerGetter(start, kind, fields));
       break;
-    case BinKind::EagerMethod:
+    case BinASTKind::EagerMethod:
       MOZ_TRY_VAR(result, parseInterfaceEagerMethod(start, kind, fields));
       break;
-    case BinKind::EagerSetter:
+    case BinASTKind::EagerSetter:
       MOZ_TRY_VAR(result, parseInterfaceEagerSetter(start, kind, fields));
       break;
-    case BinKind::LazyGetter:
+    case BinASTKind::LazyGetter:
       MOZ_TRY_VAR(result, parseInterfaceLazyGetter(start, kind, fields));
       break;
-    case BinKind::LazyMethod:
+    case BinASTKind::LazyMethod:
       MOZ_TRY_VAR(result, parseInterfaceLazyMethod(start, kind, fields));
       break;
-    case BinKind::LazySetter:
+    case BinASTKind::LazySetter:
       MOZ_TRY_VAR(result, parseInterfaceLazySetter(start, kind, fields));
       break;
-    case BinKind::ShorthandProperty:
+    case BinASTKind::ShorthandProperty:
       MOZ_TRY_VAR(result, parseInterfaceShorthandProperty(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("ObjectProperty", kind);
   }
   return result;
 }
 
 /*
 Parameter ::= ArrayBinding
     BindingIdentifier
     BindingWithInitializer
     ObjectBinding
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseParameter() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumParameter(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumParameter(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayBinding:
+    case BinASTKind::ArrayBinding:
       MOZ_TRY_VAR(result, parseInterfaceArrayBinding(start, kind, fields));
       break;
-    case BinKind::BindingIdentifier:
+    case BinASTKind::BindingIdentifier:
       MOZ_TRY_VAR(result, parseInterfaceBindingIdentifier(start, kind, fields));
       if (!pc_->positionalFormalParameterNames().append(
               result->template as<NameNode>().atom())) {
         return raiseOOM();
       }
       if (pc_->isFunctionBox()) {
         pc_->functionBox()->length++;
       }
       break;
-    case BinKind::BindingWithInitializer:
+    case BinASTKind::BindingWithInitializer:
       MOZ_TRY_VAR(result,
                   parseInterfaceBindingWithInitializer(start, kind, fields));
       break;
-    case BinKind::ObjectBinding:
+    case BinASTKind::ObjectBinding:
       MOZ_TRY_VAR(result, parseInterfaceObjectBinding(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("Parameter", kind);
   }
   return result;
 }
 
 /*
 Program ::= Module
     Script
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseProgram() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumProgram(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumProgram(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::Module:
+    case BinASTKind::Module:
       MOZ_TRY_VAR(result, parseInterfaceModule(start, kind, fields));
       break;
-    case BinKind::Script:
+    case BinASTKind::Script:
       MOZ_TRY_VAR(result, parseInterfaceScript(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("Program", kind);
   }
   return result;
 }
 
 /*
 PropertyName ::= ComputedPropertyName
     LiteralPropertyName
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parsePropertyName() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumPropertyName(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumPropertyName(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ComputedPropertyName:
+    case BinASTKind::ComputedPropertyName:
       MOZ_TRY_VAR(result,
                   parseInterfaceComputedPropertyName(start, kind, fields));
       break;
-    case BinKind::LiteralPropertyName:
+    case BinASTKind::LiteralPropertyName:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralPropertyName(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("PropertyName", kind);
   }
   return result;
 }
 
 /*
 SimpleAssignmentTarget ::= AssignmentTargetIdentifier
     ComputedMemberAssignmentTarget
     StaticMemberAssignmentTarget
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSimpleAssignmentTarget() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result,
                      parseSumSimpleAssignmentTarget(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumSimpleAssignmentTarget(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::AssignmentTargetIdentifier:
+    case BinASTKind::AssignmentTargetIdentifier:
       MOZ_TRY_VAR(result, parseInterfaceAssignmentTargetIdentifier(start, kind,
                                                                    fields));
       break;
-    case BinKind::ComputedMemberAssignmentTarget:
+    case BinASTKind::ComputedMemberAssignmentTarget:
       MOZ_TRY_VAR(result, parseInterfaceComputedMemberAssignmentTarget(
                               start, kind, fields));
       break;
-    case BinKind::StaticMemberAssignmentTarget:
+    case BinASTKind::StaticMemberAssignmentTarget:
       MOZ_TRY_VAR(result, parseInterfaceStaticMemberAssignmentTarget(
                               start, kind, fields));
       break;
     default:
       return raiseInvalidKind("SimpleAssignmentTarget", kind);
   }
   return result;
 }
@@ -864,152 +864,152 @@ SpreadElementOrExpression ::= ArrayExpre
     ThisExpression
     UnaryExpression
     UpdateExpression
     YieldExpression
     YieldStarExpression
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSpreadElementOrExpression() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result,
                      parseSumSpreadElementOrExpression(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumSpreadElementOrExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayExpression:
+    case BinASTKind::ArrayExpression:
       MOZ_TRY_VAR(result, parseInterfaceArrayExpression(start, kind, fields));
       break;
-    case BinKind::AssignmentExpression:
+    case BinASTKind::AssignmentExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceAssignmentExpression(start, kind, fields));
       break;
-    case BinKind::AwaitExpression:
+    case BinASTKind::AwaitExpression:
       MOZ_TRY_VAR(result, parseInterfaceAwaitExpression(start, kind, fields));
       break;
-    case BinKind::BinaryExpression:
+    case BinASTKind::BinaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceBinaryExpression(start, kind, fields));
       break;
-    case BinKind::CallExpression:
+    case BinASTKind::CallExpression:
       MOZ_TRY_VAR(result, parseInterfaceCallExpression(start, kind, fields));
       break;
-    case BinKind::ClassExpression:
+    case BinASTKind::ClassExpression:
       MOZ_TRY_VAR(result, parseInterfaceClassExpression(start, kind, fields));
       break;
-    case BinKind::CompoundAssignmentExpression:
+    case BinASTKind::CompoundAssignmentExpression:
       MOZ_TRY_VAR(result, parseInterfaceCompoundAssignmentExpression(
                               start, kind, fields));
       break;
-    case BinKind::ComputedMemberExpression:
+    case BinASTKind::ComputedMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceComputedMemberExpression(start, kind, fields));
       break;
-    case BinKind::ConditionalExpression:
+    case BinASTKind::ConditionalExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceConditionalExpression(start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithExpression:
+    case BinASTKind::EagerArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithFunctionBody:
+    case BinASTKind::EagerArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::EagerFunctionExpression:
+    case BinASTKind::EagerFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceEagerFunctionExpression(start, kind, fields));
       break;
-    case BinKind::IdentifierExpression:
+    case BinASTKind::IdentifierExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceIdentifierExpression(start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithExpression:
+    case BinASTKind::LazyArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithFunctionBody:
+    case BinASTKind::LazyArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::LazyFunctionExpression:
+    case BinASTKind::LazyFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLazyFunctionExpression(start, kind, fields));
       break;
-    case BinKind::LiteralBooleanExpression:
+    case BinASTKind::LiteralBooleanExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralBooleanExpression(start, kind, fields));
       break;
-    case BinKind::LiteralInfinityExpression:
+    case BinASTKind::LiteralInfinityExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralInfinityExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNullExpression:
+    case BinASTKind::LiteralNullExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNullExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNumericExpression:
+    case BinASTKind::LiteralNumericExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNumericExpression(start, kind, fields));
       break;
-    case BinKind::LiteralRegExpExpression:
+    case BinASTKind::LiteralRegExpExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralRegExpExpression(start, kind, fields));
       break;
-    case BinKind::LiteralStringExpression:
+    case BinASTKind::LiteralStringExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralStringExpression(start, kind, fields));
       break;
-    case BinKind::NewExpression:
+    case BinASTKind::NewExpression:
       MOZ_TRY_VAR(result, parseInterfaceNewExpression(start, kind, fields));
       break;
-    case BinKind::NewTargetExpression:
+    case BinASTKind::NewTargetExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceNewTargetExpression(start, kind, fields));
       break;
-    case BinKind::ObjectExpression:
+    case BinASTKind::ObjectExpression:
       MOZ_TRY_VAR(result, parseInterfaceObjectExpression(start, kind, fields));
       break;
-    case BinKind::SpreadElement:
+    case BinASTKind::SpreadElement:
       MOZ_TRY_VAR(result, parseInterfaceSpreadElement(start, kind, fields));
       break;
-    case BinKind::StaticMemberExpression:
+    case BinASTKind::StaticMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceStaticMemberExpression(start, kind, fields));
       break;
-    case BinKind::TemplateExpression:
+    case BinASTKind::TemplateExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceTemplateExpression(start, kind, fields));
       break;
-    case BinKind::ThisExpression:
+    case BinASTKind::ThisExpression:
       MOZ_TRY_VAR(result, parseInterfaceThisExpression(start, kind, fields));
       break;
-    case BinKind::UnaryExpression:
+    case BinASTKind::UnaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceUnaryExpression(start, kind, fields));
       break;
-    case BinKind::UpdateExpression:
+    case BinASTKind::UpdateExpression:
       MOZ_TRY_VAR(result, parseInterfaceUpdateExpression(start, kind, fields));
       break;
-    case BinKind::YieldExpression:
+    case BinASTKind::YieldExpression:
       MOZ_TRY_VAR(result, parseInterfaceYieldExpression(start, kind, fields));
       break;
-    case BinKind::YieldStarExpression:
+    case BinASTKind::YieldStarExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceYieldStarExpression(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("SpreadElementOrExpression", kind);
   }
   return result;
 }
@@ -1037,277 +1037,277 @@ Statement ::= Block
     TryCatchStatement
     TryFinallyStatement
     VariableDeclaration
     WhileStatement
     WithStatement
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseStatement() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumStatement(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::Block:
+    case BinASTKind::Block:
       MOZ_TRY_VAR(result, parseInterfaceBlock(start, kind, fields));
       break;
-    case BinKind::BreakStatement:
+    case BinASTKind::BreakStatement:
       MOZ_TRY_VAR(result, parseInterfaceBreakStatement(start, kind, fields));
       break;
-    case BinKind::ClassDeclaration:
+    case BinASTKind::ClassDeclaration:
       MOZ_TRY_VAR(result, parseInterfaceClassDeclaration(start, kind, fields));
       break;
-    case BinKind::ContinueStatement:
+    case BinASTKind::ContinueStatement:
       MOZ_TRY_VAR(result, parseInterfaceContinueStatement(start, kind, fields));
       break;
-    case BinKind::DebuggerStatement:
+    case BinASTKind::DebuggerStatement:
       MOZ_TRY_VAR(result, parseInterfaceDebuggerStatement(start, kind, fields));
       break;
-    case BinKind::DoWhileStatement:
+    case BinASTKind::DoWhileStatement:
       MOZ_TRY_VAR(result, parseInterfaceDoWhileStatement(start, kind, fields));
       break;
-    case BinKind::EagerFunctionDeclaration:
+    case BinASTKind::EagerFunctionDeclaration:
       MOZ_TRY_VAR(result,
                   parseInterfaceEagerFunctionDeclaration(start, kind, fields));
       break;
-    case BinKind::EmptyStatement:
+    case BinASTKind::EmptyStatement:
       MOZ_TRY_VAR(result, parseInterfaceEmptyStatement(start, kind, fields));
       break;
-    case BinKind::ExpressionStatement:
+    case BinASTKind::ExpressionStatement:
       MOZ_TRY_VAR(result,
                   parseInterfaceExpressionStatement(start, kind, fields));
       break;
-    case BinKind::ForInStatement:
+    case BinASTKind::ForInStatement:
       MOZ_TRY_VAR(result, parseInterfaceForInStatement(start, kind, fields));
       break;
-    case BinKind::ForOfStatement:
+    case BinASTKind::ForOfStatement:
       MOZ_TRY_VAR(result, parseInterfaceForOfStatement(start, kind, fields));
       break;
-    case BinKind::ForStatement:
+    case BinASTKind::ForStatement:
       MOZ_TRY_VAR(result, parseInterfaceForStatement(start, kind, fields));
       break;
-    case BinKind::IfStatement:
+    case BinASTKind::IfStatement:
       MOZ_TRY_VAR(result, parseInterfaceIfStatement(start, kind, fields));
       break;
-    case BinKind::LabelledStatement:
+    case BinASTKind::LabelledStatement:
       MOZ_TRY_VAR(result, parseInterfaceLabelledStatement(start, kind, fields));
       break;
-    case BinKind::LazyFunctionDeclaration:
+    case BinASTKind::LazyFunctionDeclaration:
       MOZ_TRY_VAR(result,
                   parseInterfaceLazyFunctionDeclaration(start, kind, fields));
       break;
-    case BinKind::ReturnStatement:
+    case BinASTKind::ReturnStatement:
       MOZ_TRY_VAR(result, parseInterfaceReturnStatement(start, kind, fields));
       break;
-    case BinKind::SwitchStatement:
+    case BinASTKind::SwitchStatement:
       MOZ_TRY_VAR(result, parseInterfaceSwitchStatement(start, kind, fields));
       break;
-    case BinKind::SwitchStatementWithDefault:
+    case BinASTKind::SwitchStatementWithDefault:
       MOZ_TRY_VAR(result, parseInterfaceSwitchStatementWithDefault(start, kind,
                                                                    fields));
       break;
-    case BinKind::ThrowStatement:
+    case BinASTKind::ThrowStatement:
       MOZ_TRY_VAR(result, parseInterfaceThrowStatement(start, kind, fields));
       break;
-    case BinKind::TryCatchStatement:
+    case BinASTKind::TryCatchStatement:
       MOZ_TRY_VAR(result, parseInterfaceTryCatchStatement(start, kind, fields));
       break;
-    case BinKind::TryFinallyStatement:
+    case BinASTKind::TryFinallyStatement:
       MOZ_TRY_VAR(result,
                   parseInterfaceTryFinallyStatement(start, kind, fields));
       break;
-    case BinKind::VariableDeclaration:
+    case BinASTKind::VariableDeclaration:
       MOZ_TRY_VAR(result,
                   parseInterfaceVariableDeclaration(start, kind, fields));
       break;
-    case BinKind::WhileStatement:
+    case BinASTKind::WhileStatement:
       MOZ_TRY_VAR(result, parseInterfaceWhileStatement(start, kind, fields));
       break;
-    case BinKind::WithStatement:
+    case BinASTKind::WithStatement:
       MOZ_TRY_VAR(result, parseInterfaceWithStatement(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("Statement", kind);
   }
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseSumVariableDeclarationOrExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayExpression:
+    case BinASTKind::ArrayExpression:
       MOZ_TRY_VAR(result, parseInterfaceArrayExpression(start, kind, fields));
       break;
-    case BinKind::AssignmentExpression:
+    case BinASTKind::AssignmentExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceAssignmentExpression(start, kind, fields));
       break;
-    case BinKind::AwaitExpression:
+    case BinASTKind::AwaitExpression:
       MOZ_TRY_VAR(result, parseInterfaceAwaitExpression(start, kind, fields));
       break;
-    case BinKind::BinaryExpression:
+    case BinASTKind::BinaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceBinaryExpression(start, kind, fields));
       break;
-    case BinKind::CallExpression:
+    case BinASTKind::CallExpression:
       MOZ_TRY_VAR(result, parseInterfaceCallExpression(start, kind, fields));
       break;
-    case BinKind::ClassExpression:
+    case BinASTKind::ClassExpression:
       MOZ_TRY_VAR(result, parseInterfaceClassExpression(start, kind, fields));
       break;
-    case BinKind::CompoundAssignmentExpression:
+    case BinASTKind::CompoundAssignmentExpression:
       MOZ_TRY_VAR(result, parseInterfaceCompoundAssignmentExpression(
                               start, kind, fields));
       break;
-    case BinKind::ComputedMemberExpression:
+    case BinASTKind::ComputedMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceComputedMemberExpression(start, kind, fields));
       break;
-    case BinKind::ConditionalExpression:
+    case BinASTKind::ConditionalExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceConditionalExpression(start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithExpression:
+    case BinASTKind::EagerArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithFunctionBody:
+    case BinASTKind::EagerArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::EagerFunctionExpression:
+    case BinASTKind::EagerFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceEagerFunctionExpression(start, kind, fields));
       break;
-    case BinKind::IdentifierExpression:
+    case BinASTKind::IdentifierExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceIdentifierExpression(start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithExpression:
+    case BinASTKind::LazyArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithFunctionBody:
+    case BinASTKind::LazyArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::LazyFunctionExpression:
+    case BinASTKind::LazyFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLazyFunctionExpression(start, kind, fields));
       break;
-    case BinKind::LiteralBooleanExpression:
+    case BinASTKind::LiteralBooleanExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralBooleanExpression(start, kind, fields));
       break;
-    case BinKind::LiteralInfinityExpression:
+    case BinASTKind::LiteralInfinityExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralInfinityExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNullExpression:
+    case BinASTKind::LiteralNullExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNullExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNumericExpression:
+    case BinASTKind::LiteralNumericExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNumericExpression(start, kind, fields));
       break;
-    case BinKind::LiteralRegExpExpression:
+    case BinASTKind::LiteralRegExpExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralRegExpExpression(start, kind, fields));
       break;
-    case BinKind::LiteralStringExpression:
+    case BinASTKind::LiteralStringExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralStringExpression(start, kind, fields));
       break;
-    case BinKind::NewExpression:
+    case BinASTKind::NewExpression:
       MOZ_TRY_VAR(result, parseInterfaceNewExpression(start, kind, fields));
       break;
-    case BinKind::NewTargetExpression:
+    case BinASTKind::NewTargetExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceNewTargetExpression(start, kind, fields));
       break;
-    case BinKind::ObjectExpression:
+    case BinASTKind::ObjectExpression:
       MOZ_TRY_VAR(result, parseInterfaceObjectExpression(start, kind, fields));
       break;
-    case BinKind::StaticMemberExpression:
+    case BinASTKind::StaticMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceStaticMemberExpression(start, kind, fields));
       break;
-    case BinKind::TemplateExpression:
+    case BinASTKind::TemplateExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceTemplateExpression(start, kind, fields));
       break;
-    case BinKind::ThisExpression:
+    case BinASTKind::ThisExpression:
       MOZ_TRY_VAR(result, parseInterfaceThisExpression(start, kind, fields));
       break;
-    case BinKind::UnaryExpression:
+    case BinASTKind::UnaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceUnaryExpression(start, kind, fields));
       break;
-    case BinKind::UpdateExpression:
+    case BinASTKind::UpdateExpression:
       MOZ_TRY_VAR(result, parseInterfaceUpdateExpression(start, kind, fields));
       break;
-    case BinKind::VariableDeclaration:
+    case BinASTKind::VariableDeclaration:
       MOZ_TRY_VAR(result,
                   parseInterfaceVariableDeclaration(start, kind, fields));
       break;
-    case BinKind::YieldExpression:
+    case BinASTKind::YieldExpression:
       MOZ_TRY_VAR(result, parseInterfaceYieldExpression(start, kind, fields));
       break;
-    case BinKind::YieldStarExpression:
+    case BinASTKind::YieldStarExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceYieldStarExpression(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("VariableDeclarationOrExpression", kind);
   }
   return result;
 }
 
 // ----- Interfaces (autogenerated, by lexicographical order)
 // When fields have a non-trivial type, implementation is deanonymized and
 // delegated to another parser.
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceArrayAssignmentTarget(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(ArrayAssignmentTarget)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceArrayBinding(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (ArrayBinding)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceArrayExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ArrayExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ArrayExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Elements};
+  const BinASTField expected_fields[1] = {BinASTField::Elements};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(elements, parseListOfOptionalSpreadElementOrExpression());
 
   if (elements->empty()) {
     elements->setHasNonConstInitializer();
   }
@@ -1318,41 +1318,41 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 /*
  interface AssertedBlockScope : Node {
     FrozenArray<AssertedDeclaredName> declaredNames;
     bool hasDirectEval;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedBlockScope() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::AssertedBlockScope) {
+  if (kind != BinASTKind::AssertedBlockScope) {
     return raiseInvalidKind("AssertedBlockScope", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceAssertedBlockScope(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedBlockScope(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::AssertedBlockScope);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::AssertedBlockScope);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::DeclaredNames,
-                                       BinField::HasDirectEval};
+  const BinASTField expected_fields[2] = {BinASTField::DeclaredNames,
+                                          BinASTField::HasDirectEval};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto scopeKind = AssertedScopeKind::Block;
 
   MOZ_TRY(parseListOfAssertedDeclaredName(scopeKind));
 
   BINJS_MOZ_TRY_DECL(hasDirectEval, tokenizer_->readBool());
   if (hasDirectEval) {
@@ -1372,41 +1372,42 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
  interface AssertedBoundName : Node {
     [IdentifierName] string name;
     bool isCaptured;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedBoundName(
     AssertedScopeKind scopeKind) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::AssertedBoundName) {
+  if (kind != BinASTKind::AssertedBoundName) {
     return raiseInvalidKind("AssertedBoundName", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(
       result, parseInterfaceAssertedBoundName(start, kind, fields, scopeKind));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedBoundName(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     AssertedScopeKind scopeKind) {
-  MOZ_ASSERT(kind == BinKind::AssertedBoundName);
+  MOZ_ASSERT(kind == BinASTKind::AssertedBoundName);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Name, BinField::IsCaptured};
+  const BinASTField expected_fields[2] = {BinASTField::Name,
+                                          BinASTField::IsCaptured};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const bool allowDuplicateName = false;
 
   RootedAtom name(cx_);
   MOZ_TRY_VAR(name, tokenizer_->readIdentifierName());
 
   BINJS_MOZ_TRY_DECL(isCaptured, tokenizer_->readBool());
@@ -1422,41 +1423,41 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
 /*
  interface AssertedBoundNamesScope : Node {
     FrozenArray<AssertedBoundName> boundNames;
     bool hasDirectEval;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedBoundNamesScope() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::AssertedBoundNamesScope) {
+  if (kind != BinASTKind::AssertedBoundNamesScope) {
     return raiseInvalidKind("AssertedBoundNamesScope", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(
       result, parseInterfaceAssertedBoundNamesScope(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedBoundNamesScope(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::AssertedBoundNamesScope);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::AssertedBoundNamesScope);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::BoundNames,
-                                       BinField::HasDirectEval};
+  const BinASTField expected_fields[2] = {BinASTField::BoundNames,
+                                          BinASTField::HasDirectEval};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto scopeKind = AssertedScopeKind::Catch;
 
   MOZ_TRY(parseListOfAssertedBoundName(scopeKind));
 
   BINJS_MOZ_TRY_DECL(hasDirectEval, tokenizer_->readBool());
   if (hasDirectEval) {
@@ -1477,42 +1478,42 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
     [IdentifierName] string name;
     AssertedDeclaredKind kind;
     bool isCaptured;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedDeclaredName(
     AssertedScopeKind scopeKind) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::AssertedDeclaredName) {
+  if (kind != BinASTKind::AssertedDeclaredName) {
     return raiseInvalidKind("AssertedDeclaredName", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result, parseInterfaceAssertedDeclaredName(
                                  start, kind, fields, scopeKind));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedDeclaredName(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     AssertedScopeKind scopeKind) {
-  MOZ_ASSERT(kind == BinKind::AssertedDeclaredName);
+  MOZ_ASSERT(kind == BinASTKind::AssertedDeclaredName);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Name, BinField::Kind,
-                                       BinField::IsCaptured};
+  const BinASTField expected_fields[3] = {BinASTField::Name, BinASTField::Kind,
+                                          BinASTField::IsCaptured};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const bool allowDuplicateName = false;
 
   RootedAtom name(cx_);
   MOZ_TRY_VAR(name, tokenizer_->readIdentifierName());
 
   BINJS_MOZ_TRY_DECL(kind_, parseAssertedDeclaredKind());
@@ -1537,43 +1538,43 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
     FrozenArray<AssertedMaybePositionalParameterName> paramNames;
     bool hasDirectEval;
     bool isSimpleParameterList;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedParameterScope(
     MutableHandle<GCVector<JSAtom*>> positionalParams) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::AssertedParameterScope) {
+  if (kind != BinASTKind::AssertedParameterScope) {
     return raiseInvalidKind("AssertedParameterScope", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result, parseInterfaceAssertedParameterScope(
                                  start, kind, fields, positionalParams));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedParameterScope(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     MutableHandle<GCVector<JSAtom*>> positionalParams) {
-  MOZ_ASSERT(kind == BinKind::AssertedParameterScope);
+  MOZ_ASSERT(kind == BinASTKind::AssertedParameterScope);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::ParamNames,
-                                       BinField::HasDirectEval,
-                                       BinField::IsSimpleParameterList};
+  const BinASTField expected_fields[3] = {BinASTField::ParamNames,
+                                          BinASTField::HasDirectEval,
+                                          BinASTField::IsSimpleParameterList};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto scopeKind = AssertedScopeKind::Parameter;
 
   MOZ_TRY(parseListOfAssertedMaybePositionalParameterName(scopeKind,
                                                           positionalParams));
 
   BINJS_MOZ_TRY_DECL(hasDirectEval, tokenizer_->readBool());
@@ -1589,25 +1590,25 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
     pc_->functionBox()->setHasExtensibleScope();
   }
   auto result = Ok();
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedPositionalParameterName(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     AssertedScopeKind scopeKind,
     MutableHandle<GCVector<JSAtom*>> positionalParams) {
-  MOZ_ASSERT(kind == BinKind::AssertedPositionalParameterName);
+  MOZ_ASSERT(kind == BinASTKind::AssertedPositionalParameterName);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Index, BinField::Name,
-                                       BinField::IsCaptured};
+  const BinASTField expected_fields[3] = {BinASTField::Index, BinASTField::Name,
+                                          BinASTField::IsCaptured};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   bool allowDuplicateName = !pc_->sc()->strict();
 
   BINJS_MOZ_TRY_DECL(index, tokenizer_->readUnsignedLong());
 
   RootedAtom name(cx_);
   MOZ_TRY_VAR(name, tokenizer_->readIdentifierName());
@@ -1646,41 +1647,41 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
 /*
  interface AssertedScriptGlobalScope : Node {
     FrozenArray<AssertedDeclaredName> declaredNames;
     bool hasDirectEval;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedScriptGlobalScope() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::AssertedScriptGlobalScope) {
+  if (kind != BinASTKind::AssertedScriptGlobalScope) {
     return raiseInvalidKind("AssertedScriptGlobalScope", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(
       result, parseInterfaceAssertedScriptGlobalScope(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedScriptGlobalScope(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::AssertedScriptGlobalScope);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::AssertedScriptGlobalScope);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::DeclaredNames,
-                                       BinField::HasDirectEval};
+  const BinASTField expected_fields[2] = {BinASTField::DeclaredNames,
+                                          BinASTField::HasDirectEval};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto scopeKind = AssertedScopeKind::Global;
 
   MOZ_TRY(parseListOfAssertedDeclaredName(scopeKind));
 
   BINJS_MOZ_TRY_DECL(hasDirectEval, tokenizer_->readBool());
   if (hasDirectEval) {
@@ -1699,41 +1700,41 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
 /*
  interface AssertedVarScope : Node {
     FrozenArray<AssertedDeclaredName> declaredNames;
     bool hasDirectEval;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedVarScope() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::AssertedVarScope) {
+  if (kind != BinASTKind::AssertedVarScope) {
     return raiseInvalidKind("AssertedVarScope", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceAssertedVarScope(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedVarScope(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::AssertedVarScope);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::AssertedVarScope);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::DeclaredNames,
-                                       BinField::HasDirectEval};
+  const BinASTField expected_fields[2] = {BinASTField::DeclaredNames,
+                                          BinASTField::HasDirectEval};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto scopeKind = AssertedScopeKind::Var;
 
   MOZ_TRY(parseListOfAssertedDeclaredName(scopeKind));
 
   BINJS_MOZ_TRY_DECL(hasDirectEval, tokenizer_->readBool());
   if (hasDirectEval) {
@@ -1746,72 +1747,73 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
     pc_->functionBox()->setHasExtensibleScope();
   }
   auto result = Ok();
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceAssignmentExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::AssignmentExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::AssignmentExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Binding, BinField::Expression};
+  const BinASTField expected_fields[2] = {BinASTField::Binding,
+                                          BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(binding, parseAssignmentTarget());
 
   BINJS_MOZ_TRY_DECL(expression, parseExpression());
 
   BINJS_TRY_DECL(result, handler_.newAssignment(ParseNodeKind::AssignExpr,
                                                 binding, expression));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceAssignmentTargetIdentifier(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::AssignmentTargetIdentifier);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::AssignmentTargetIdentifier);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Name};
+  const BinASTField expected_fields[1] = {BinASTField::Name};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom name(cx_);
   MOZ_TRY_VAR(name, tokenizer_->readIdentifierName());
 
   BINJS_TRY(usedNames_.noteUse(cx_, name, pc_->scriptId(),
                                pc_->innermostScope()->id()));
   BINJS_TRY_DECL(result, handler_.newName(name->asPropertyName(),
                                           tokenizer_->pos(start), cx_));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceAwaitExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (AwaitExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceBinaryExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::BinaryExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::BinaryExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Operator, BinField::Left,
-                                       BinField::Right};
+  const BinASTField expected_fields[3] = {
+      BinASTField::Operator, BinASTField::Left, BinASTField::Right};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(operator_, parseBinaryOperator());
 
   BINJS_MOZ_TRY_DECL(left, parseExpression());
 
   BINJS_MOZ_TRY_DECL(right, parseExpression());
@@ -1913,90 +1915,91 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 
 /*
  interface BindingIdentifier : Node {
     [IdentifierName] string name;
  }
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseBindingIdentifier() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::BindingIdentifier) {
+  if (kind != BinASTKind::BindingIdentifier) {
     return raiseInvalidKind("BindingIdentifier", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceBindingIdentifier(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceBindingIdentifier(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::BindingIdentifier);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::BindingIdentifier);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Name};
+  const BinASTField expected_fields[1] = {BinASTField::Name};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom name(cx_);
   MOZ_TRY_VAR(name, tokenizer_->readIdentifierName());
 
   BINJS_TRY_DECL(result, handler_.newName(name->asPropertyName(),
                                           tokenizer_->pos(start), cx_));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceBindingWithInitializer(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(BindingWithInitializer)");
 }
 
 /*
  interface Block : Node {
     AssertedBlockScope scope;
     FrozenArray<Statement> statements;
  }
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseBlock() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::Block) {
+  if (kind != BinASTKind::Block) {
     return raiseInvalidKind("Block", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result, parseInterfaceBlock(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceBlock(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::Block);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::Block);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Scope, BinField::Statements};
+  const BinASTField expected_fields[2] = {BinASTField::Scope,
+                                          BinASTField::Statements};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseContext::Statement stmt(pc_, StatementKind::Block);
   ParseContext::Scope currentScope(cx_, pc_, usedNames_);
   BINJS_TRY(currentScope.init(pc_));
 
   MOZ_TRY(parseAssertedBlockScope());
 
@@ -2005,22 +2008,22 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   MOZ_TRY(checkClosedVars(currentScope));
   BINJS_TRY_DECL(bindings, NewLexicalScopeData(cx_, currentScope, alloc_, pc_));
   BINJS_TRY_DECL(result, handler_.newLexicalScope(*bindings, statements));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceBreakStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::BreakStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::BreakStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Label};
+  const BinASTField expected_fields[1] = {BinASTField::Label};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   RootedAtom label(cx_);
   MOZ_TRY_VAR(label, tokenizer_->readMaybeAtom());
 
   if (label) {
     if (!IsIdentifier(label)) {
       return raiseError("Invalid identifier");
@@ -2043,22 +2046,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   BINJS_TRY_DECL(result, handler_.newBreakStatement(
                              label ? label->asPropertyName() : nullptr,
                              tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceCallExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::CallExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::CallExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Callee, BinField::Arguments};
+  const BinASTField expected_fields[2] = {BinASTField::Callee,
+                                          BinASTField::Arguments};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(callee, parseExpressionOrSuper());
 
   BINJS_MOZ_TRY_DECL(arguments, parseArguments());
 
   auto op = JSOP_CALL;
@@ -2097,40 +2101,40 @@ JS::Result<ParseNode*> BinASTParser<Tok>
  interface CatchClause : Node {
     AssertedBoundNamesScope bindingScope;
     Binding binding;
     Block body;
  }
 */
 template <typename Tok>
 JS::Result<LexicalScopeNode*> BinASTParser<Tok>::parseCatchClause() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::CatchClause) {
+  if (kind != BinASTKind::CatchClause) {
     return raiseInvalidKind("CatchClause", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result, parseInterfaceCatchClause(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<LexicalScopeNode*> BinASTParser<Tok>::parseInterfaceCatchClause(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::CatchClause);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::CatchClause);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::BindingScope,
-                                       BinField::Binding, BinField::Body};
+  const BinASTField expected_fields[3] = {
+      BinASTField::BindingScope, BinASTField::Binding, BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseContext::Statement stmt(pc_, StatementKind::Catch);
   ParseContext::Scope currentScope(cx_, pc_, usedNames_);
   BINJS_TRY(currentScope.init(pc_));
 
   MOZ_TRY(parseAssertedBoundNamesScope());
 
@@ -2145,38 +2149,38 @@ JS::Result<LexicalScopeNode*> BinASTPars
   BINJS_TRY_DECL(bindings, NewLexicalScopeData(cx_, currentScope, alloc_, pc_));
   BINJS_TRY_DECL(result, handler_.newLexicalScope(*bindings, body));
   BINJS_TRY(handler_.setupCatchScope(result, binding, body));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceClassDeclaration(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (ClassDeclaration)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceClassExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (ClassExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceCompoundAssignmentExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::CompoundAssignmentExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::CompoundAssignmentExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Operator, BinField::Binding,
-                                       BinField::Expression};
+  const BinASTField expected_fields[3] = {
+      BinASTField::Operator, BinASTField::Binding, BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(operator_, parseCompoundAssignmentOperator());
 
   BINJS_MOZ_TRY_DECL(binding, parseSimpleAssignmentTarget());
 
   BINJS_MOZ_TRY_DECL(expression, parseExpression());
@@ -2222,93 +2226,95 @@ BinASTParser<Tok>::parseInterfaceCompoun
   }
   BINJS_TRY_DECL(result, handler_.newAssignment(pnk, binding, expression));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceComputedMemberAssignmentTarget(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ComputedMemberAssignmentTarget);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ComputedMemberAssignmentTarget);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Object, BinField::Expression};
+  const BinASTField expected_fields[2] = {BinASTField::Object,
+                                          BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(object, parseExpressionOrSuper());
 
   BINJS_MOZ_TRY_DECL(expression, parseExpression());
 
   BINJS_TRY_DECL(result, handler_.newPropertyByValue(object, expression,
                                                      tokenizer_->offset()));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceComputedMemberExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ComputedMemberExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ComputedMemberExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Object, BinField::Expression};
+  const BinASTField expected_fields[2] = {BinASTField::Object,
+                                          BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(object, parseExpressionOrSuper());
 
   BINJS_MOZ_TRY_DECL(expression, parseExpression());
 
   BINJS_TRY_DECL(result, handler_.newPropertyByValue(object, expression,
                                                      tokenizer_->offset()));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceComputedPropertyName(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(ComputedPropertyName)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceConditionalExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ConditionalExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ConditionalExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Test, BinField::Consequent,
-                                       BinField::Alternate};
+  const BinASTField expected_fields[3] = {
+      BinASTField::Test, BinASTField::Consequent, BinASTField::Alternate};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(test, parseExpression());
 
   BINJS_MOZ_TRY_DECL(consequent, parseExpression());
 
   BINJS_MOZ_TRY_DECL(alternate, parseExpression());
 
   BINJS_TRY_DECL(result, handler_.newConditional(test, consequent, alternate));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceContinueStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ContinueStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ContinueStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Label};
+  const BinASTField expected_fields[1] = {BinASTField::Label};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   RootedAtom label(cx_);
   MOZ_TRY_VAR(label, tokenizer_->readMaybeAtom());
 
   if (label) {
     if (!IsIdentifier(label)) {
       return raiseError("ContinueStatement - Label MUST be an identifier");
@@ -2331,22 +2337,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   BINJS_TRY_DECL(result, handler_.newContinueStatement(
                              label ? label->asPropertyName() : nullptr,
                              tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceDataProperty(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::DataProperty);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::DataProperty);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Name, BinField::Expression};
+  const BinASTField expected_fields[2] = {BinASTField::Name,
+                                          BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(name, parsePropertyName());
 
   BINJS_MOZ_TRY_DECL(expression, parseExpression());
 
   if (!handler_.isUsableAsObjectPropertyName(name)) {
@@ -2362,112 +2369,112 @@ JS::Result<ParseNode*> BinASTParser<Tok>
     BINJS_TRY_VAR(result, handler_.newObjectMethodOrPropertyDefinition(
                               name, expression, AccessorType::None));
   }
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceDebuggerStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (DebuggerStatement)");
 }
 
 /*
  interface Directive : Node {
     string rawValue;
  }
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseDirective() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::Directive) {
+  if (kind != BinASTKind::Directive) {
     return raiseInvalidKind("Directive", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result, parseInterfaceDirective(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceDirective(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::Directive);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::Directive);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::RawValue};
+  const BinASTField expected_fields[1] = {BinASTField::RawValue};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom rawValue(cx_);
   MOZ_TRY_VAR(rawValue, tokenizer_->readAtom());
 
   TokenPos pos = tokenizer_->pos(start);
   BINJS_TRY_DECL(result, handler_.newStringLiteral(rawValue, pos));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceDoWhileStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::DoWhileStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::DoWhileStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Test, BinField::Body};
+  const BinASTField expected_fields[2] = {BinASTField::Test, BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseContext::Statement stmt(pc_, StatementKind::DoLoop);
 
   BINJS_MOZ_TRY_DECL(test, parseExpression());
 
   BINJS_MOZ_TRY_DECL(body, parseStatement());
 
   BINJS_TRY_DECL(
       result, handler_.newDoWhileStatement(body, test, tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceEagerArrowExpressionWithExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(EagerArrowExpressionWithExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceEagerArrowExpressionWithFunctionBody(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(EagerArrowExpressionWithFunctionBody)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceEagerFunctionDeclaration(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::EagerFunctionDeclaration);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::EagerFunctionDeclaration);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[6] = {
-      BinField::IsAsync, BinField::IsGenerator, BinField::Name,
-      BinField::Length,  BinField::Directives,  BinField::Contents};
+  const BinASTField expected_fields[6] = {
+      BinASTField::IsAsync, BinASTField::IsGenerator, BinASTField::Name,
+      BinASTField::Length,  BinASTField::Directives,  BinASTField::Contents};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto syntax = FunctionSyntaxKind::Statement;
 
   BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
   if (isAsync) {
     return raiseError(
         "Async function is not supported in this preview release");
@@ -2513,24 +2520,24 @@ BinASTParser<Tok>::parseInterfaceEagerFu
   BINJS_TRY_DECL(bodyScope, handler_.newLexicalScope(*lexicalScopeData, body));
   BINJS_MOZ_TRY_DECL(result,
                      buildFunction(start, kind, name, params, bodyScope));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceEagerFunctionExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::EagerFunctionExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::EagerFunctionExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[6] = {
-      BinField::IsAsync, BinField::IsGenerator, BinField::Name,
-      BinField::Length,  BinField::Directives,  BinField::Contents};
+  const BinASTField expected_fields[6] = {
+      BinASTField::IsAsync, BinASTField::IsGenerator, BinASTField::Name,
+      BinASTField::Length,  BinASTField::Directives,  BinASTField::Contents};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto syntax = FunctionSyntaxKind::Expression;
 
   BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
   if (isAsync) {
     return raiseError(
         "Async function is not supported in this preview release");
@@ -2576,23 +2583,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   BINJS_TRY_DECL(bodyScope, handler_.newLexicalScope(*lexicalScopeData, body));
   BINJS_MOZ_TRY_DECL(result,
                      buildFunction(start, kind, name, params, bodyScope));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceEagerGetter(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::EagerGetter);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::EagerGetter);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Name, BinField::Directives,
-                                       BinField::Contents};
+  const BinASTField expected_fields[3] = {
+      BinASTField::Name, BinASTField::Directives, BinASTField::Contents};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto syntax = FunctionSyntaxKind::Setter;
   const bool isGenerator = false;
   const bool isAsync = false;
   const auto accessorType = AccessorType::Getter;
   const uint32_t length = 0;
 
@@ -2633,24 +2640,24 @@ JS::Result<ParseNode*> BinASTParser<Tok>
                      buildFunction(start, kind, name, params, bodyScope));
   BINJS_TRY_DECL(result, handler_.newObjectMethodOrPropertyDefinition(
                              name, method, accessorType));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceEagerMethod(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::EagerMethod);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::EagerMethod);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[6] = {
-      BinField::IsAsync, BinField::IsGenerator, BinField::Name,
-      BinField::Length,  BinField::Directives,  BinField::Contents};
+  const BinASTField expected_fields[6] = {
+      BinASTField::IsAsync, BinASTField::IsGenerator, BinASTField::Name,
+      BinASTField::Length,  BinASTField::Directives,  BinASTField::Contents};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto syntax = FunctionSyntaxKind::Method;
   const auto accessorType = AccessorType::None;
 
   BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
   if (isAsync) {
     return raiseError(
@@ -2699,24 +2706,24 @@ JS::Result<ParseNode*> BinASTParser<Tok>
                      buildFunction(start, kind, name, params, bodyScope));
   BINJS_TRY_DECL(result, handler_.newObjectMethodOrPropertyDefinition(
                              name, method, accessorType));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceEagerSetter(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::EagerSetter);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::EagerSetter);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[4] = {BinField::Name, BinField::Length,
-                                       BinField::Directives,
-                                       BinField::Contents};
+  const BinASTField expected_fields[4] = {
+      BinASTField::Name, BinASTField::Length, BinASTField::Directives,
+      BinASTField::Contents};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto syntax = FunctionSyntaxKind::Setter;
   const bool isGenerator = false;
   const bool isAsync = false;
   const auto accessorType = AccessorType::Setter;
 
   BINJS_MOZ_TRY_DECL(name, parsePropertyName());
@@ -2758,51 +2765,52 @@ JS::Result<ParseNode*> BinASTParser<Tok>
                      buildFunction(start, kind, name, params, bodyScope));
   BINJS_TRY_DECL(result, handler_.newObjectMethodOrPropertyDefinition(
                              name, method, accessorType));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceEmptyStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::EmptyStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::EmptyStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
   MOZ_TRY(tokenizer_->checkFields0(kind, fields));
 
   BINJS_TRY_DECL(result, handler_.newEmptyStatement(tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceExpressionStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ExpressionStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ExpressionStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Expression};
+  const BinASTField expected_fields[1] = {BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(expression, parseExpression());
 
   BINJS_TRY_DECL(result,
                  handler_.newExprStatement(expression, tokenizer_->offset()));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceForInOfBinding(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ForInOfBinding);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ForInOfBinding);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Kind, BinField::Binding};
+  const BinASTField expected_fields[2] = {BinASTField::Kind,
+                                          BinASTField::Binding};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   AutoVariableDeclarationKind kindGuard(this);
 
   BINJS_MOZ_TRY_DECL(kind_, parseVariableDeclarationKind());
 
   BINJS_MOZ_TRY_DECL(binding, parseBinding());
 
@@ -2823,23 +2831,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   BINJS_TRY_DECL(result,
                  handler_.newDeclarationList(pnk, tokenizer_->pos(start)));
   handler_.addList(result, binding);
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceForInStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ForInStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ForInStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Left, BinField::Right,
-                                       BinField::Body};
+  const BinASTField expected_fields[3] = {BinASTField::Left, BinASTField::Right,
+                                          BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseContext::Statement stmt(pc_, StatementKind::ForInLoop);
 
   // Implicit scope around the `for`, used to store `for (let x in  ...)`
   // or `for (const x in ...)`-style declarations. Detail on the
   // declaration is stored as part of `scope`.
   ParseContext::Scope scope(cx_, pc_, usedNames_);
@@ -2862,30 +2870,31 @@ JS::Result<ParseNode*> BinASTParser<Tok>
     BINJS_TRY_DECL(bindings, NewLexicalScopeData(cx_, scope, alloc_, pc_));
     BINJS_TRY_VAR(result, handler_.newLexicalScope(*bindings, result));
   }
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceForOfStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (ForOfStatement)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceForStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ForStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ForStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[4] = {BinField::Init, BinField::Test,
-                                       BinField::Update, BinField::Body};
+  const BinASTField expected_fields[4] = {BinASTField::Init, BinASTField::Test,
+                                          BinASTField::Update,
+                                          BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseContext::Statement stmt(pc_, StatementKind::ForLoop);
 
   // Implicit scope around the `for`, used to store `for (let x; ...; ...)`
   // or `for (const x; ...; ...)`-style declarations. Detail on the
   // declaration is stored as part of `BINJS_Scope`.
   ParseContext::Scope scope(cx_, pc_, usedNames_);
@@ -2915,40 +2924,41 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 /*
  interface FormalParameters : Node {
     FrozenArray<Parameter> items;
     Binding? rest;
  }
 */
 template <typename Tok>
 JS::Result<ListNode*> BinASTParser<Tok>::parseFormalParameters() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::FormalParameters) {
+  if (kind != BinASTKind::FormalParameters) {
     return raiseInvalidKind("FormalParameters", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceFormalParameters(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ListNode*> BinASTParser<Tok>::parseInterfaceFormalParameters(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::FormalParameters);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::FormalParameters);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Items, BinField::Rest};
+  const BinASTField expected_fields[2] = {BinASTField::Items,
+                                          BinASTField::Rest};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(items, parseListOfParameter());
 
   BINJS_MOZ_TRY_DECL(rest, parseOptionalBinding());
 
   auto result = items;
@@ -2967,47 +2977,47 @@ JS::Result<ListNode*> BinASTParser<Tok>:
     FormalParameters params;
     AssertedVarScope bodyScope;
     FunctionBody body;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseFunctionExpressionContents(
     uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::FunctionExpressionContents) {
+  if (kind != BinASTKind::FunctionExpressionContents) {
     return raiseInvalidKind("FunctionExpressionContents", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceFunctionExpressionContents(
                          start, kind, fields, funLength, paramsOut, bodyOut));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceFunctionExpressionContents(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut) {
-  MOZ_ASSERT(kind == BinKind::FunctionExpressionContents);
+  MOZ_ASSERT(kind == BinASTKind::FunctionExpressionContents);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[6] = {BinField::IsFunctionNameCaptured,
-                                       BinField::IsThisCaptured,
-                                       BinField::ParameterScope,
-                                       BinField::Params,
-                                       BinField::BodyScope,
-                                       BinField::Body};
+  const BinASTField expected_fields[6] = {BinASTField::IsFunctionNameCaptured,
+                                          BinASTField::IsThisCaptured,
+                                          BinASTField::ParameterScope,
+                                          BinASTField::Params,
+                                          BinASTField::BodyScope,
+                                          BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(isFunctionNameCaptured, tokenizer_->readBool());
   // Per spec, isFunctionNameCaptured can be true for anonymous
   // function.  Check isFunctionNameCaptured only for named
   // function.
   if (pc_->functionBox()->function()->isNamedLambda() &&
@@ -3040,44 +3050,44 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
     FormalParameters params;
     AssertedVarScope bodyScope;
     FunctionBody body;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseFunctionOrMethodContents(
     uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::FunctionOrMethodContents) {
+  if (kind != BinASTKind::FunctionOrMethodContents) {
     return raiseInvalidKind("FunctionOrMethodContents", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceFunctionOrMethodContents(
                          start, kind, fields, funLength, paramsOut, bodyOut));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceFunctionOrMethodContents(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut) {
-  MOZ_ASSERT(kind == BinKind::FunctionOrMethodContents);
+  MOZ_ASSERT(kind == BinASTKind::FunctionOrMethodContents);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[5] = {
-      BinField::IsThisCaptured, BinField::ParameterScope, BinField::Params,
-      BinField::BodyScope, BinField::Body};
+  const BinASTField expected_fields[5] = {
+      BinASTField::IsThisCaptured, BinASTField::ParameterScope,
+      BinASTField::Params, BinASTField::BodyScope, BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(isThisCaptured, tokenizer_->readBool());
   // TODO: Use this in BinASTParser::buildFunction.
   (void)isThisCaptured;
   Rooted<GCVector<JSAtom*>> positionalParams(cx_, GCVector<JSAtom*>(cx_));
   MOZ_TRY(parseAssertedParameterScope(&positionalParams));
@@ -3101,43 +3111,43 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
     AssertedVarScope bodyScope;
     FunctionBody body;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseGetterContents(uint32_t funLength,
                                                       ListNode** paramsOut,
                                                       ListNode** bodyOut) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::GetterContents) {
+  if (kind != BinASTKind::GetterContents) {
     return raiseInvalidKind("GetterContents", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(
       result, parseInterfaceGetterContents(start, kind, fields, funLength,
                                            paramsOut, bodyOut));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceGetterContents(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut) {
-  MOZ_ASSERT(kind == BinKind::GetterContents);
+  MOZ_ASSERT(kind == BinASTKind::GetterContents);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::IsThisCaptured,
-                                       BinField::BodyScope, BinField::Body};
+  const BinASTField expected_fields[3] = {
+      BinASTField::IsThisCaptured, BinASTField::BodyScope, BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(isThisCaptured, tokenizer_->readBool());
   // TODO: Use this in BinASTParser::buildFunction.
   (void)isThisCaptured;
   MOZ_TRY(parseAssertedVarScope());
 
@@ -3152,84 +3162,85 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
 
 /*
  interface IdentifierExpression : Node {
     [IdentifierName] string name;
  }
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseIdentifierExpression() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::IdentifierExpression) {
+  if (kind != BinASTKind::IdentifierExpression) {
     return raiseInvalidKind("IdentifierExpression", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceIdentifierExpression(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceIdentifierExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::IdentifierExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::IdentifierExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Name};
+  const BinASTField expected_fields[1] = {BinASTField::Name};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom name(cx_);
   MOZ_TRY_VAR(name, tokenizer_->readIdentifierName());
 
   BINJS_TRY(usedNames_.noteUse(cx_, name, pc_->scriptId(),
                                pc_->innermostScope()->id()));
   BINJS_TRY_DECL(result, handler_.newName(name->asPropertyName(),
                                           tokenizer_->pos(start), cx_));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceIfStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::IfStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::IfStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Test, BinField::Consequent,
-                                       BinField::Alternate};
+  const BinASTField expected_fields[3] = {
+      BinASTField::Test, BinASTField::Consequent, BinASTField::Alternate};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(test, parseExpression());
 
   BINJS_MOZ_TRY_DECL(consequent, parseStatement());
 
   BINJS_MOZ_TRY_DECL(alternate, parseOptionalStatement());
 
   BINJS_TRY_DECL(result,
                  handler_.newIfStatement(start, test, consequent, alternate));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLabelledStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LabelledStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LabelledStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Label, BinField::Body};
+  const BinASTField expected_fields[2] = {BinASTField::Label,
+                                          BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom label(cx_);
   MOZ_TRY_VAR(label, tokenizer_->readAtom());
   if (!IsIdentifier(label)) {
     return raiseError("Invalid identifier");
   }
@@ -3239,42 +3250,42 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   BINJS_TRY_DECL(result, handler_.newLabeledStatement(label->asPropertyName(),
                                                       body, start));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceLazyArrowExpressionWithExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(LazyArrowExpressionWithExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceLazyArrowExpressionWithFunctionBody(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(LazyArrowExpressionWithFunctionBody)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLazyFunctionDeclaration(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LazyFunctionDeclaration);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LazyFunctionDeclaration);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[7] = {
-      BinField::IsAsync, BinField::IsGenerator, BinField::Name,
-      BinField::Length,  BinField::Directives,  BinField::ContentsSkip,
-      BinField::Contents};
+  const BinASTField expected_fields[7] = {
+      BinASTField::IsAsync, BinASTField::IsGenerator, BinASTField::Name,
+      BinASTField::Length,  BinASTField::Directives,  BinASTField::ContentsSkip,
+      BinASTField::Contents};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto syntax = FunctionSyntaxKind::Statement;
 
   BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
   if (isAsync) {
     return raiseError(
         "Async function is not supported in this preview release");
@@ -3321,25 +3332,25 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   funbox->function()->initLazyScript(lazy);
 
   BINJS_MOZ_TRY_DECL(result, makeEmptyFunctionNode(skipStart, kind, funbox));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLazyFunctionExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LazyFunctionExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LazyFunctionExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[7] = {
-      BinField::IsAsync, BinField::IsGenerator, BinField::Name,
-      BinField::Length,  BinField::Directives,  BinField::ContentsSkip,
-      BinField::Contents};
+  const BinASTField expected_fields[7] = {
+      BinASTField::IsAsync, BinASTField::IsGenerator, BinASTField::Name,
+      BinASTField::Length,  BinASTField::Directives,  BinASTField::ContentsSkip,
+      BinASTField::Contents};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto syntax = FunctionSyntaxKind::Expression;
 
   BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
   if (isAsync) {
     return raiseError(
         "Async function is not supported in this preview release");
@@ -3386,101 +3397,101 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   funbox->function()->initLazyScript(lazy);
 
   BINJS_MOZ_TRY_DECL(result, makeEmptyFunctionNode(skipStart, kind, funbox));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLazyGetter(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (LazyGetter)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLazyMethod(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (LazyMethod)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLazySetter(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (LazySetter)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceLiteralBooleanExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LiteralBooleanExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LiteralBooleanExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Value};
+  const BinASTField expected_fields[1] = {BinASTField::Value};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(value, tokenizer_->readBool());
 
   BINJS_TRY_DECL(result,
                  handler_.newBooleanLiteral(value, tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceLiteralInfinityExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(LiteralInfinityExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLiteralNullExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LiteralNullExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LiteralNullExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
   MOZ_TRY(tokenizer_->checkFields0(kind, fields));
 
   BINJS_TRY_DECL(result, handler_.newNullLiteral(tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceLiteralNumericExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LiteralNumericExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LiteralNumericExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Value};
+  const BinASTField expected_fields[1] = {BinASTField::Value};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(value, tokenizer_->readDouble());
 
   BINJS_TRY_DECL(result, handler_.newNumber(value, DecimalPoint::HasDecimal,
                                             tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLiteralPropertyName(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LiteralPropertyName);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LiteralPropertyName);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Value};
+  const BinASTField expected_fields[1] = {BinASTField::Value};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom value(cx_);
   MOZ_TRY_VAR(value, tokenizer_->readAtom());
 
   ParseNode* result;
   uint32_t index;
@@ -3492,22 +3503,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
     BINJS_TRY_VAR(result, handler_.newObjectLiteralPropertyName(
                               value, tokenizer_->pos(start)));
   }
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLiteralRegExpExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LiteralRegExpExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LiteralRegExpExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Pattern, BinField::Flags};
+  const BinASTField expected_fields[2] = {BinASTField::Pattern,
+                                          BinASTField::Flags};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom pattern(cx_);
   MOZ_TRY_VAR(pattern, tokenizer_->readAtom());
   Chars flags(cx_);
   MOZ_TRY(tokenizer_->readChars(flags));
 
@@ -3534,108 +3546,109 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 
   BINJS_TRY_DECL(result,
                  handler_.newRegExp(reobj, tokenizer_->pos(start), *this));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLiteralStringExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LiteralStringExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LiteralStringExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Value};
+  const BinASTField expected_fields[1] = {BinASTField::Value};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom value(cx_);
   MOZ_TRY_VAR(value, tokenizer_->readAtom());
 
   BINJS_TRY_DECL(result,
                  handler_.newStringLiteral(value, tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceModule(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (Module)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceNewExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::NewExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::NewExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Callee, BinField::Arguments};
+  const BinASTField expected_fields[2] = {BinASTField::Callee,
+                                          BinASTField::Arguments};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(callee, parseExpression());
 
   BINJS_MOZ_TRY_DECL(arguments, parseArguments());
 
   BINJS_TRY_DECL(result, handler_.newNewExpression(tokenizer_->pos(start).begin,
                                                    callee, arguments));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceNewTargetExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(NewTargetExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceObjectAssignmentTarget(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(ObjectAssignmentTarget)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceObjectBinding(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (ObjectBinding)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceObjectExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ObjectExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ObjectExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Properties};
+  const BinASTField expected_fields[1] = {BinASTField::Properties};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(properties, parseListOfObjectProperty());
 
   auto result = properties;
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceReturnStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ReturnStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ReturnStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Expression};
+  const BinASTField expected_fields[1] = {BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   if (!pc_->isFunctionBox()) {
     // Return statements are permitted only inside functions.
     return raiseInvalidKind("Toplevel Statement", kind);
   }
 
   pc_->functionBox()->usesReturn = true;
@@ -3644,23 +3657,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 
   BINJS_TRY_DECL(
       result, handler_.newReturnStatement(expression, tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceScript(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::Script);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::Script);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Scope, BinField::Directives,
-                                       BinField::Statements};
+  const BinASTField expected_fields[3] = {
+      BinASTField::Scope, BinASTField::Directives, BinASTField::Statements};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   MOZ_TRY(parseAssertedScriptGlobalScope());
 
   BINJS_MOZ_TRY_DECL(directives, parseListOfDirective());
   forceStrictIfNecessary(pc_->sc(), directives);
   BINJS_MOZ_TRY_DECL(statements, parseListOfStatement());
@@ -3679,44 +3692,44 @@ JS::Result<ParseNode*> BinASTParser<Tok>
     AssertedVarScope bodyScope;
     FunctionBody body;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseSetterContents(uint32_t funLength,
                                                       ListNode** paramsOut,
                                                       ListNode** bodyOut) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::SetterContents) {
+  if (kind != BinASTKind::SetterContents) {
     return raiseInvalidKind("SetterContents", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(
       result, parseInterfaceSetterContents(start, kind, fields, funLength,
                                            paramsOut, bodyOut));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceSetterContents(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut) {
-  MOZ_ASSERT(kind == BinKind::SetterContents);
+  MOZ_ASSERT(kind == BinASTKind::SetterContents);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[5] = {
-      BinField::IsThisCaptured, BinField::ParameterScope, BinField::Param,
-      BinField::BodyScope, BinField::Body};
+  const BinASTField expected_fields[5] = {
+      BinASTField::IsThisCaptured, BinASTField::ParameterScope,
+      BinASTField::Param, BinASTField::BodyScope, BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(isThisCaptured, tokenizer_->readBool());
   // TODO: Use this in BinASTParser::buildFunction.
   (void)isThisCaptured;
   Rooted<GCVector<JSAtom*>> positionalParams(cx_, GCVector<JSAtom*>(cx_));
   MOZ_TRY(parseAssertedParameterScope(&positionalParams));
@@ -3732,22 +3745,22 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
   *paramsOut = params;
   *bodyOut = body;
   auto result = Ok();
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceShorthandProperty(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ShorthandProperty);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ShorthandProperty);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Name};
+  const BinASTField expected_fields[1] = {BinASTField::Name};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(name, parseIdentifierExpression());
 
   MOZ_ASSERT(name->isKind(ParseNodeKind::Name));
   MOZ_ASSERT(!handler_.isUsableAsObjectPropertyName(name));
   BINJS_TRY_DECL(propName, handler_.newObjectLiteralPropertyName(
@@ -3756,30 +3769,31 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 
   BINJS_TRY_DECL(result,
                  handler_.newShorthandPropertyDefinition(propName, name));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceSpreadElement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (SpreadElement)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceStaticMemberAssignmentTarget(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::StaticMemberAssignmentTarget);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::StaticMemberAssignmentTarget);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Object, BinField::Property};
+  const BinASTField expected_fields[2] = {BinASTField::Object,
+                                          BinASTField::Property};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   size_t nameStart;
 
   BINJS_MOZ_TRY_DECL(object, parseExpressionOrSuper());
   RootedAtom property(cx_);
   {
     nameStart = tokenizer_->offset();
@@ -3789,22 +3803,23 @@ BinASTParser<Tok>::parseInterfaceStaticM
   BINJS_TRY_DECL(name, handler_.newPropertyName(property->asPropertyName(),
                                                 tokenizer_->pos(nameStart)));
   BINJS_TRY_DECL(result, handler_.newPropertyAccess(object, name));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceStaticMemberExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::StaticMemberExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::StaticMemberExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Object, BinField::Property};
+  const BinASTField expected_fields[2] = {BinASTField::Object,
+                                          BinASTField::Property};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   size_t nameStart;
 
   BINJS_MOZ_TRY_DECL(object, parseExpressionOrSuper());
   RootedAtom property(cx_);
   {
     nameStart = tokenizer_->offset();
@@ -3814,52 +3829,53 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   BINJS_TRY_DECL(name, handler_.newPropertyName(property->asPropertyName(),
                                                 tokenizer_->pos(nameStart)));
   BINJS_TRY_DECL(result, handler_.newPropertyAccess(object, name));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceSuper(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (Super)");
 }
 
 /*
  interface SwitchCase : Node {
     Expression test;
     FrozenArray<Statement> consequent;
  }
 */
 template <typename Tok>
 JS::Result<CaseClause*> BinASTParser<Tok>::parseSwitchCase() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::SwitchCase) {
+  if (kind != BinASTKind::SwitchCase) {
     return raiseInvalidKind("SwitchCase", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result, parseInterfaceSwitchCase(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<CaseClause*> BinASTParser<Tok>::parseInterfaceSwitchCase(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::SwitchCase);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::SwitchCase);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Test, BinField::Consequent};
+  const BinASTField expected_fields[2] = {BinASTField::Test,
+                                          BinASTField::Consequent};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(test, parseExpression());
 
   BINJS_MOZ_TRY_DECL(consequent, parseListOfStatement());
 
   BINJS_TRY_DECL(result, handler_.newCaseOrDefault(start, test, consequent));
@@ -3868,80 +3884,81 @@ JS::Result<CaseClause*> BinASTParser<Tok
 
 /*
  interface SwitchDefault : Node {
     FrozenArray<Statement> consequent;
  }
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSwitchDefault() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::SwitchDefault) {
+  if (kind != BinASTKind::SwitchDefault) {
     return raiseInvalidKind("SwitchDefault", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result, parseInterfaceSwitchDefault(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceSwitchDefault(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::SwitchDefault);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::SwitchDefault);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Consequent};
+  const BinASTField expected_fields[1] = {BinASTField::Consequent};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(consequent, parseListOfStatement());
 
   BINJS_TRY_DECL(result, handler_.newCaseOrDefault(start, nullptr, consequent));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceSwitchStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::SwitchStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::SwitchStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Discriminant, BinField::Cases};
+  const BinASTField expected_fields[2] = {BinASTField::Discriminant,
+                                          BinASTField::Cases};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(discriminant, parseExpression());
   ParseContext::Statement stmt(pc_, StatementKind::Switch);
   BINJS_MOZ_TRY_DECL(cases, parseListOfSwitchCase());
 
   BINJS_TRY_DECL(scope, handler_.newLexicalScope(nullptr, cases));
   BINJS_TRY_DECL(result, handler_.newSwitchStatement(start, discriminant, scope,
                                                      /* hasDefault = */ false));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceSwitchStatementWithDefault(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::SwitchStatementWithDefault);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::SwitchStatementWithDefault);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[4] = {
-      BinField::Discriminant, BinField::PreDefaultCases, BinField::DefaultCase,
-      BinField::PostDefaultCases};
+  const BinASTField expected_fields[4] = {
+      BinASTField::Discriminant, BinASTField::PreDefaultCases,
+      BinASTField::DefaultCase, BinASTField::PostDefaultCases};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(discriminant, parseExpression());
   ParseContext::Statement stmt(pc_, StatementKind::Switch);
   BINJS_MOZ_TRY_DECL(preDefaultCases, parseListOfSwitchCase());
 
   BINJS_MOZ_TRY_DECL(defaultCase, parseSwitchDefault());
@@ -3960,26 +3977,26 @@ BinASTParser<Tok>::parseInterfaceSwitchS
   BINJS_TRY_DECL(scope, handler_.newLexicalScope(nullptr, cases));
   BINJS_TRY_DECL(result, handler_.newSwitchStatement(start, discriminant, scope,
                                                      /* hasDefault = */ true));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceTemplateExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(TemplateExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceThisExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ThisExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ThisExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
   MOZ_TRY(tokenizer_->checkFields0(kind, fields));
 
   if (pc_->isFunctionBox()) {
     pc_->functionBox()->usesThis = true;
   }
 
   TokenPos pos = tokenizer_->pos(start);
@@ -3992,40 +4009,41 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   }
 
   BINJS_TRY_DECL(result, handler_.newThisLiteral(pos, thisName));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceThrowStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ThrowStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ThrowStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Expression};
+  const BinASTField expected_fields[1] = {BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(expression, parseExpression());
 
   BINJS_TRY_DECL(
       result, handler_.newThrowStatement(expression, tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceTryCatchStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::TryCatchStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::TryCatchStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Body, BinField::CatchClause};
+  const BinASTField expected_fields[2] = {BinASTField::Body,
+                                          BinASTField::CatchClause};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseNode* body;
   {
     ParseContext::Statement stmt(pc_, StatementKind::Try);
     ParseContext::Scope scope(cx_, pc_, usedNames_);
     BINJS_TRY(scope.init(pc_));
     MOZ_TRY_VAR(body, parseBlock());
@@ -4036,23 +4054,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   BINJS_TRY_DECL(result,
                  handler_.newTryStatement(start, body, catchClause,
                                           /* finallyBlock = */ nullptr));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceTryFinallyStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::TryFinallyStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::TryFinallyStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Body, BinField::CatchClause,
-                                       BinField::Finalizer};
+  const BinASTField expected_fields[3] = {
+      BinASTField::Body, BinASTField::CatchClause, BinASTField::Finalizer};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseNode* body;
   {
     ParseContext::Statement stmt(pc_, StatementKind::Try);
     ParseContext::Scope scope(cx_, pc_, usedNames_);
     BINJS_TRY(scope.init(pc_));
     MOZ_TRY_VAR(body, parseBlock());
@@ -4069,22 +4087,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 
   BINJS_TRY_DECL(result,
                  handler_.newTryStatement(start, body, catchClause, finalizer));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceUnaryExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::UnaryExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::UnaryExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Operator, BinField::Operand};
+  const BinASTField expected_fields[2] = {BinASTField::Operator,
+                                          BinASTField::Operand};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(operator_, parseUnaryOperator());
 
   BINJS_MOZ_TRY_DECL(operand, parseExpression());
 
   ParseNodeKind pnk;
@@ -4133,23 +4152,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
     }
   }
   BINJS_TRY_DECL(result, handler_.newUnary(pnk, start, operand));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceUpdateExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::UpdateExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::UpdateExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::IsPrefix, BinField::Operator,
-                                       BinField::Operand};
+  const BinASTField expected_fields[3] = {
+      BinASTField::IsPrefix, BinASTField::Operator, BinASTField::Operand};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(isPrefix, tokenizer_->readBool());
 
   BINJS_MOZ_TRY_DECL(operator_, parseUpdateOperator());
 
   BINJS_MOZ_TRY_DECL(operand, parseSimpleAssignmentTarget());
@@ -4166,22 +4185,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
       break;
   }
   BINJS_TRY_DECL(result, handler_.newUnary(pnk, start, operand));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceVariableDeclaration(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::VariableDeclaration);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::VariableDeclaration);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Kind, BinField::Declarators};
+  const BinASTField expected_fields[2] = {BinASTField::Kind,
+                                          BinASTField::Declarators};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   AutoVariableDeclarationKind kindGuard(this);
 
   BINJS_MOZ_TRY_DECL(kind_, parseVariableDeclarationKind());
   // Restored by `kindGuard`.
   variableDeclarationKind_ = kind_;
   ParseNodeKind declarationListKind;
@@ -4209,40 +4229,41 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 /*
  interface VariableDeclarator : Node {
     Binding binding;
     Expression? init;
  }
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseVariableDeclarator() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::VariableDeclarator) {
+  if (kind != BinASTKind::VariableDeclarator) {
     return raiseInvalidKind("VariableDeclarator", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceVariableDeclarator(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceVariableDeclarator(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::VariableDeclarator);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::VariableDeclarator);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Binding, BinField::Init};
+  const BinASTField expected_fields[2] = {BinASTField::Binding,
+                                          BinASTField::Init};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(binding, parseBinding());
 
   BINJS_MOZ_TRY_DECL(init, parseOptionalExpression());
 
   ParseNode* result;
@@ -4256,79 +4277,80 @@ JS::Result<ParseNode*> BinASTParser<Tok>
     } else {
       result = bindingNameNode;
     }
   } else {
     // `var pattern = bar`
     if (!init) {
       // Here, `init` is required.
       return raiseMissingField("VariableDeclarator (with non-trivial pattern)",
-                               BinField::Init);
+                               BinASTField::Init);
     }
 
     MOZ_CRASH(
         "Unimplemented: AssertedScope check for BindingPattern variable "
         "declaration");
     BINJS_TRY_VAR(result, handler_.newAssignment(ParseNodeKind::AssignExpr,
                                                  binding, init));
   }
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceWhileStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::WhileStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::WhileStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Test, BinField::Body};
+  const BinASTField expected_fields[2] = {BinASTField::Test, BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseContext::Statement stmt(pc_, StatementKind::WhileLoop);
 
   BINJS_MOZ_TRY_DECL(test, parseExpression());
 
   BINJS_MOZ_TRY_DECL(body, parseStatement());
 
   BINJS_TRY_DECL(result, handler_.newWhileStatement(start, test, body));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceWithStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::WithStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::WithStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Object, BinField::Body};
+  const BinASTField expected_fields[2] = {BinASTField::Object,
+                                          BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(object, parseExpression());
 
   ParseContext::Statement stmt(pc_, StatementKind::With);
   BINJS_MOZ_TRY_DECL(body, parseStatement());
 
   pc_->sc()->setBindingsAccessedDynamically();
   BINJS_TRY_DECL(result, handler_.newWithStatement(start, object, body));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceYieldExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (YieldExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceYieldStarExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(YieldStarExpression)");
 }
 
 // ----- String enums (autogenerated, by lexicographical order)
 /*
 enum AssertedDeclaredKind {
@@ -4338,21 +4360,21 @@ enum AssertedDeclaredKind {
 };
 */
 template <typename Tok>
 JS::Result<typename BinASTParser<Tok>::AssertedDeclaredKind>
 BinASTParser<Tok>::parseAssertedDeclaredKind() {
   BINJS_MOZ_TRY_DECL(variant, tokenizer_->readVariant());
 
   switch (variant) {
-    case BinVariant::AssertedDeclaredKindOrVariableDeclarationKindVar:
+    case BinASTVariant::AssertedDeclaredKindOrVariableDeclarationKindVar:
       return AssertedDeclaredKind::Var;
-    case BinVariant::AssertedDeclaredKindNonConstLexical:
+    case BinASTVariant::AssertedDeclaredKindNonConstLexical:
       return AssertedDeclaredKind::NonConstLexical;
-    case BinVariant::AssertedDeclaredKindConstLexical:
+    case BinASTVariant::AssertedDeclaredKindConstLexical:
       return AssertedDeclaredKind::ConstLexical;
     default:
       return raiseInvalidVariant("AssertedDeclaredKind", variant);
   }
 }
 
 /*
 enum BinaryOperator {
@@ -4384,65 +4406,65 @@ enum BinaryOperator {
 };
 */
 template <typename Tok>
 JS::Result<typename BinASTParser<Tok>::BinaryOperator>
 BinASTParser<Tok>::parseBinaryOperator() {
   BINJS_MOZ_TRY_DECL(variant, tokenizer_->readVariant());
 
   switch (variant) {
-    case BinVariant::BinaryOperatorComma:
+    case BinASTVariant::BinaryOperatorComma:
       return BinaryOperator::Comma;
-    case BinVariant::BinaryOperatorLogicalOr:
+    case BinASTVariant::BinaryOperatorLogicalOr:
       return BinaryOperator::LogicalOr;
-    case BinVariant::BinaryOperatorLogicalAnd:
+    case BinASTVariant::BinaryOperatorLogicalAnd:
       return BinaryOperator::LogicalAnd;
-    case BinVariant::BinaryOperatorBitOr:
+    case BinASTVariant::BinaryOperatorBitOr:
       return BinaryOperator::BitOr;
-    case BinVariant::BinaryOperatorBitXor:
+    case BinASTVariant::BinaryOperatorBitXor:
       return BinaryOperator::BitXor;
-    case BinVariant::BinaryOperatorBitAnd:
+    case BinASTVariant::BinaryOperatorBitAnd:
       return BinaryOperator::BitAnd;
-    case BinVariant::BinaryOperatorEq:
+    case BinASTVariant::BinaryOperatorEq:
       return BinaryOperator::Eq;
-    case BinVariant::BinaryOperatorNeq:
+    case BinASTVariant::BinaryOperatorNeq:
       return BinaryOperator::Neq;
-    case BinVariant::BinaryOperatorStrictEq:
+    case BinASTVariant::BinaryOperatorStrictEq:
       return BinaryOperator::StrictEq;
-    case BinVariant::BinaryOperatorStrictNeq:
+    case BinASTVariant::BinaryOperatorStrictNeq:
       return BinaryOperator::StrictNeq;
-    case BinVariant::BinaryOperatorLessThan:
+    case BinASTVariant::BinaryOperatorLessThan:
       return BinaryOperator::LessThan;
-    case BinVariant::BinaryOperatorLeqThan:
+    case BinASTVariant::BinaryOperatorLeqThan:
       return BinaryOperator::LeqThan;
-    case BinVariant::BinaryOperatorGreaterThan:
+    case BinASTVariant::BinaryOperatorGreaterThan:
       return BinaryOperator::GreaterThan;
-    case BinVariant::BinaryOperatorGeqThan:
+    case BinASTVariant::BinaryOperatorGeqThan:
       return BinaryOperator::GeqThan;
-    case BinVariant::BinaryOperatorIn:
+    case BinASTVariant::BinaryOperatorIn:
       return BinaryOperator::In;
-    case BinVariant::BinaryOperatorInstanceof:
+    case BinASTVariant::BinaryOperatorInstanceof:
       return BinaryOperator::Instanceof;
-    case BinVariant::BinaryOperatorLsh:
+    case BinASTVariant::BinaryOperatorLsh:
       return BinaryOperator::Lsh;
-    case BinVariant::BinaryOperatorRsh:
+    case BinASTVariant::BinaryOperatorRsh:
       return BinaryOperator::Rsh;
-    case BinVariant::BinaryOperatorUrsh:
+    case BinASTVariant::BinaryOperatorUrsh:
       return BinaryOperator::Ursh;
-    case BinVariant::BinaryOperatorOrUnaryOperatorPlus:
+    case BinASTVariant::BinaryOperatorOrUnaryOperatorPlus:
       return BinaryOperator::Plus;
-    case BinVariant::BinaryOperatorOrUnaryOperatorMinus:
+    case BinASTVariant::BinaryOperatorOrUnaryOperatorMinus:
       return BinaryOperator::Minus;
-    case BinVariant::BinaryOperatorMul:
+    case BinASTVariant::BinaryOperatorMul:
       return BinaryOperator::Mul;
-    case BinVariant::BinaryOperatorDiv:
+    case BinASTVariant::BinaryOperatorDiv:
       return BinaryOperator::Div;
-    case BinVariant::BinaryOperatorMod:
+    case BinASTVariant::BinaryOperatorMod:
       return BinaryOperator::Mod;
-    case BinVariant::BinaryOperatorPow:
+    case BinASTVariant::BinaryOperatorPow:
       return BinaryOperator::Pow;
     default:
       return raiseInvalidVariant("BinaryOperator", variant);
   }
 }
 
 /*
 enum CompoundAssignmentOperator {
@@ -4461,39 +4483,39 @@ enum CompoundAssignmentOperator {
 };
 */
 template <typename Tok>
 JS::Result<typename BinASTParser<Tok>::CompoundAssignmentOperator>
 BinASTParser<Tok>::parseCompoundAssignmentOperator() {
   BINJS_MOZ_TRY_DECL(variant, tokenizer_->readVariant());
 
   switch (variant) {
-    case BinVariant::CompoundAssignmentOperatorPlusAssign:
+    case BinASTVariant::CompoundAssignmentOperatorPlusAssign:
       return CompoundAssignmentOperator::PlusAssign;
-    case BinVariant::CompoundAssignmentOperatorMinusAssign:
+    case BinASTVariant::CompoundAssignmentOperatorMinusAssign:
       return CompoundAssignmentOperator::MinusAssign;
-    case BinVariant::CompoundAssignmentOperatorMulAssign:
+    case BinASTVariant::CompoundAssignmentOperatorMulAssign:
       return CompoundAssignmentOperator::MulAssign;
-    case BinVariant::CompoundAssignmentOperatorDivAssign:
+    case BinASTVariant::CompoundAssignmentOperatorDivAssign:
       return CompoundAssignmentOperator::DivAssign;
-    case BinVariant::CompoundAssignmentOperatorModAssign:
+    case BinASTVariant::CompoundAssignmentOperatorModAssign:
       return CompoundAssignmentOperator::ModAssign;
-    case BinVariant::CompoundAssignmentOperatorPowAssign:
+    case BinASTVariant::CompoundAssignmentOperatorPowAssign:
       return CompoundAssignmentOperator::PowAssign;
-    case BinVariant::CompoundAssignmentOperatorLshAssign:
+    case BinASTVariant::CompoundAssignmentOperatorLshAssign:
       return CompoundAssignmentOperator::LshAssign;
-    case BinVariant::CompoundAssignmentOperatorRshAssign:
+    case BinASTVariant::CompoundAssignmentOperatorRshAssign:
       return CompoundAssignmentOperator::RshAssign;
-    case BinVariant::CompoundAssignmentOperatorUrshAssign:
+    case BinASTVariant::CompoundAssignmentOperatorUrshAssign:
       return CompoundAssignmentOperator::UrshAssign;
-    case BinVariant::CompoundAssignmentOperatorBitOrAssign:
+    case BinASTVariant::CompoundAssignmentOperatorBitOrAssign:
       return CompoundAssignmentOperator::BitOrAssign;
-    case BinVariant::CompoundAssignmentOperatorBitXorAssign:
+    case BinASTVariant::CompoundAssignmentOperatorBitXorAssign:
       return CompoundAssignmentOperator::BitXorAssign;
-    case BinVariant::CompoundAssignmentOperatorBitAndAssign:
+    case BinASTVariant::CompoundAssignmentOperatorBitAndAssign:
       return CompoundAssignmentOperator::BitAndAssign;
     default:
       return raiseInvalidVariant("CompoundAssignmentOperator", variant);
   }
 }
 
 /*
 enum UnaryOperator {
@@ -4507,29 +4529,29 @@ enum UnaryOperator {
 };
 */
 template <typename Tok>
 JS::Result<typename BinASTParser<Tok>::UnaryOperator>
 BinASTParser<Tok>::parseUnaryOperator() {
   BINJS_MOZ_TRY_DECL(variant, tokenizer_->readVariant());
 
   switch (variant) {
-    case BinVariant::BinaryOperatorOrUnaryOperatorPlus:
+    case BinASTVariant::BinaryOperatorOrUnaryOperatorPlus:
       return UnaryOperator::Plus;
-    case BinVariant::BinaryOperatorOrUnaryOperatorMinus:
+    case BinASTVariant::BinaryOperatorOrUnaryOperatorMinus:
       return UnaryOperator::Minus;
-    case BinVariant::UnaryOperatorNot:
+    case BinASTVariant::UnaryOperatorNot:
       return UnaryOperator::Not;
-    case BinVariant::UnaryOperatorBitNot:
+    case BinASTVariant::UnaryOperatorBitNot:
       return UnaryOperator::BitNot;
-    case BinVariant::UnaryOperatorTypeof:
+    case BinASTVariant::UnaryOperatorTypeof:
       return UnaryOperator::Typeof;
-    case BinVariant::UnaryOperatorVoid:
+    case BinASTVariant::UnaryOperatorVoid:
       return UnaryOperator::Void;
-    case BinVariant::UnaryOperatorDelete:
+    case BinASTVariant::UnaryOperatorDelete:
       return UnaryOperator::Delete;
     default:
       return raiseInvalidVariant("UnaryOperator", variant);
   }
 }
 
 /*
 enum UpdateOperator {
@@ -4538,19 +4560,19 @@ enum UpdateOperator {
 };
 */
 template <typename Tok>
 JS::Result<typename BinASTParser<Tok>::UpdateOperator>
 BinASTParser<Tok>::parseUpdateOperator() {
   BINJS_MOZ_TRY_DECL(variant, tokenizer_->readVariant());
 
   switch (variant) {
-    case BinVariant::UpdateOperatorIncr:
+    case BinASTVariant::UpdateOperatorIncr:
       return UpdateOperator::Incr;
-    case BinVariant::UpdateOperatorDecr:
+    case BinASTVariant::UpdateOperatorDecr:
       return UpdateOperator::Decr;
     default:
       return raiseInvalidVariant("UpdateOperator", variant);
   }
 }
 
 /*
 enum VariableDeclarationKind {
@@ -4560,21 +4582,21 @@ enum VariableDeclarationKind {
 };
 */
 template <typename Tok>
 JS::Result<typename BinASTParser<Tok>::VariableDeclarationKind>
 BinASTParser<Tok>::parseVariableDeclarationKind() {
   BINJS_MOZ_TRY_DECL(variant, tokenizer_->readVariant());
 
   switch (variant) {
-    case BinVariant::AssertedDeclaredKindOrVariableDeclarationKindVar:
+    case BinASTVariant::AssertedDeclaredKindOrVariableDeclarationKindVar:
       return VariableDeclarationKind::Var;
-    case BinVariant::VariableDeclarationKindLet:
+    case BinASTVariant::VariableDeclarationKindLet:
       return VariableDeclarationKind::Let;
-    case BinVariant::VariableDeclarationKindConst:
+    case BinASTVariant::VariableDeclarationKindConst:
       return VariableDeclarationKind::Const;
     default:
       return raiseInvalidVariant("VariableDeclarationKind", variant);
   }
 }
 
 // ----- Lists (autogenerated, by lexicographical order)
 
@@ -4818,143 +4840,143 @@ JS::Result<ListNode*> BinASTParser<Tok>:
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 // ----- Default values (by lexicographical order)
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseOptionalBinding() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
   ParseNode* result;
-  if (kind == BinKind::_Null) {
+  if (kind == BinASTKind::_Null) {
     result = nullptr;
   } else {
     const auto start = tokenizer_->offset();
     MOZ_TRY_VAR(result, parseSumBinding(start, kind, fields));
   }
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseOptionalBindingIdentifier() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
   ParseNode* result;
-  if (kind == BinKind::_Null) {
+  if (kind == BinASTKind::_Null) {
     result = nullptr;
-  } else if (kind == BinKind::BindingIdentifier) {
+  } else if (kind == BinASTKind::BindingIdentifier) {
     const auto start = tokenizer_->offset();
     MOZ_TRY_VAR(result, parseInterfaceBindingIdentifier(start, kind, fields));
   } else {
     return raiseInvalidKind("BindingIdentifier", kind);
   }
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<LexicalScopeNode*> BinASTParser<Tok>::parseOptionalCatchClause() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
   LexicalScopeNode* result;
-  if (kind == BinKind::_Null) {
+  if (kind == BinASTKind::_Null) {
     result = nullptr;
-  } else if (kind == BinKind::CatchClause) {
+  } else if (kind == BinASTKind::CatchClause) {
     const auto start = tokenizer_->offset();
     MOZ_TRY_VAR(result, parseInterfaceCatchClause(start, kind, fields));
   } else {
     return raiseInvalidKind("CatchClause", kind);
   }
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseOptionalExpression() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
   ParseNode* result;
-  if (kind == BinKind::_Null) {
+  if (kind == BinASTKind::_Null) {
     result = nullptr;
   } else {
     const auto start = tokenizer_->offset();
     MOZ_TRY_VAR(result, parseSumExpression(start, kind, fields));
   }
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseOptionalSpreadElementOrExpression() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
   ParseNode* result;
-  if (kind == BinKind::_Null) {
+  if (kind == BinASTKind::_Null) {
     result = nullptr;
   } else {
     const auto start = tokenizer_->offset();
     MOZ_TRY_VAR(result, parseSumSpreadElementOrExpression(start, kind, fields));
   }
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseOptionalStatement() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
   ParseNode* result;
-  if (kind == BinKind::_Null) {
+  if (kind == BinASTKind::_Null) {
     result = nullptr;
   } else {
     const auto start = tokenizer_->offset();
     MOZ_TRY_VAR(result, parseSumStatement(start, kind, fields));
   }
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseOptionalVariableDeclarationOrExpression() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
   ParseNode* result;
-  if (kind == BinKind::_Null) {
+  if (kind == BinASTKind::_Null) {
     result = nullptr;
   } else {
     const auto start = tokenizer_->offset();
     MOZ_TRY_VAR(result,
                 parseSumVariableDeclarationOrExpression(start, kind, fields));
   }
   MOZ_TRY(guard.done());
 
--- a/js/src/frontend/BinASTParser.h
+++ b/js/src/frontend/BinASTParser.h
@@ -33,17 +33,17 @@ namespace frontend {
 
 template <typename Tok>
 class BinASTParser : public BinASTParserPerTokenizer<Tok> {
  public:
   using Base = BinASTParserPerTokenizer<Tok>;
 
   using Tokenizer = Tok;
 
-  using BinFields = typename Tokenizer::BinFields;
+  using BinASTFields = typename Tokenizer::BinASTFields;
   using AutoList = typename Tokenizer::AutoList;
   using AutoTaggedTuple = typename Tokenizer::AutoTaggedTuple;
   using Chars = typename Tokenizer::Chars;
 
  public:
   // Auto-generated types.
   using AssertedDeclaredKind = binast::AssertedDeclaredKind;
   using BinaryOperator = binast::BinaryOperator;
@@ -130,52 +130,54 @@ class BinASTParser : public BinASTParser
   JS::Result<ParseNode*> parseObjectProperty();
   JS::Result<ParseNode*> parseParameter();
   JS::Result<ParseNode*> parseProgram();
   JS::Result<ParseNode*> parsePropertyName();
   JS::Result<ParseNode*> parseSimpleAssignmentTarget();
   JS::Result<ParseNode*> parseSpreadElementOrExpression();
   JS::Result<ParseNode*> parseStatement();
   JS::Result<Ok> parseSumAssertedMaybePositionalParameterName(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       AssertedScopeKind scopeKind,
       MutableHandle<GCVector<JSAtom*>> positionalParams);
   JS::Result<ParseNode*> parseSumAssignmentTarget(const size_t start,
-                                                  const BinKind kind,
-                                                  const BinFields& fields);
-  JS::Result<ParseNode*> parseSumBinding(const size_t start, const BinKind kind,
-                                         const BinFields& fields);
+                                                  const BinASTKind kind,
+                                                  const BinASTFields& fields);
+  JS::Result<ParseNode*> parseSumBinding(const size_t start,
+                                         const BinASTKind kind,
+                                         const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumExpression(const size_t start,
-                                            const BinKind kind,
-                                            const BinFields& fields);
+                                            const BinASTKind kind,
+                                            const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumExpressionOrSuper(const size_t start,
-                                                   const BinKind kind,
-                                                   const BinFields& fields);
+                                                   const BinASTKind kind,
+                                                   const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumForInOfBindingOrAssignmentTarget(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumObjectProperty(const size_t start,
-                                                const BinKind kind,
-                                                const BinFields& fields);
+                                                const BinASTKind kind,
+                                                const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumParameter(const size_t start,
-                                           const BinKind kind,
-                                           const BinFields& fields);
-  JS::Result<ParseNode*> parseSumProgram(const size_t start, const BinKind kind,
-                                         const BinFields& fields);
+                                           const BinASTKind kind,
+                                           const BinASTFields& fields);
+  JS::Result<ParseNode*> parseSumProgram(const size_t start,
+                                         const BinASTKind kind,
+                                         const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumPropertyName(const size_t start,
-                                              const BinKind kind,
-                                              const BinFields& fields);
+                                              const BinASTKind kind,
+                                              const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumSimpleAssignmentTarget(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumSpreadElementOrExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumStatement(const size_t start,
-                                           const BinKind kind,
-                                           const BinFields& fields);
+                                           const BinASTKind kind,
+                                           const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumVariableDeclarationOrExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
 
   // ----- Interfaces (by lexicographical order)
   // `ParseNode*` may never be nullptr
   JS::Result<Ok> parseAssertedBlockScope();
   JS::Result<Ok> parseAssertedBoundName(AssertedScopeKind scopeKind);
   JS::Result<Ok> parseAssertedBoundNamesScope();
   JS::Result<Ok> parseAssertedDeclaredName(AssertedScopeKind scopeKind);
   JS::Result<Ok> parseAssertedParameterScope(
@@ -197,262 +199,239 @@ class BinASTParser : public BinASTParser
                                      ListNode** bodyOut);
   JS::Result<ParseNode*> parseIdentifierExpression();
   JS::Result<Ok> parseSetterContents(uint32_t funLength, ListNode** paramsOut,
                                      ListNode** bodyOut);
   JS::Result<CaseClause*> parseSwitchCase();
   JS::Result<ParseNode*> parseSwitchDefault();
   JS::Result<ParseNode*> parseVariableDeclarator();
   JS::Result<ParseNode*> parseInterfaceArrayAssignmentTarget(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceArrayBinding(const size_t start,
-                                                    const BinKind kind,
-                                                    const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceArrayExpression(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+                                                    const BinASTKind kind,
+                                                    const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceArrayExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<Ok> parseInterfaceAssertedBlockScope(const size_t start,
-                                                  const BinKind kind,
-                                                  const BinFields& fields);
+                                                  const BinASTKind kind,
+                                                  const BinASTFields& fields);
   JS::Result<Ok> parseInterfaceAssertedBoundName(const size_t start,
-                                                 const BinKind kind,
-                                                 const BinFields& fields,
+                                                 const BinASTKind kind,
+                                                 const BinASTFields& fields,
                                                  AssertedScopeKind scopeKind);
-  JS::Result<Ok> parseInterfaceAssertedBoundNamesScope(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+  JS::Result<Ok> parseInterfaceAssertedBoundNamesScope(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<Ok> parseInterfaceAssertedDeclaredName(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       AssertedScopeKind scopeKind);
   JS::Result<Ok> parseInterfaceAssertedParameterScope(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       MutableHandle<GCVector<JSAtom*>> positionalParams);
   JS::Result<Ok> parseInterfaceAssertedPositionalParameterName(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       AssertedScopeKind scopeKind,
       MutableHandle<GCVector<JSAtom*>> positionalParams);
   JS::Result<Ok> parseInterfaceAssertedScriptGlobalScope(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<Ok> parseInterfaceAssertedVarScope(const size_t start,
-                                                const BinKind kind,
-                                                const BinFields& fields);
+                                                const BinASTKind kind,
+                                                const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceAssignmentExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceAssignmentTargetIdentifier(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceAwaitExpression(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceAwaitExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceBinaryExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceBindingIdentifier(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceBindingWithInitializer(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceBlock(const size_t start,
-                                             const BinKind kind,
-                                             const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceBreakStatement(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceCallExpression(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
+                                             const BinASTKind kind,
+                                             const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceBreakStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceCallExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<LexicalScopeNode*> parseInterfaceCatchClause(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceClassDeclaration(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceClassExpression(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceClassExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceCompoundAssignmentExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceComputedMemberAssignmentTarget(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceComputedMemberExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceComputedPropertyName(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceConditionalExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceContinueStatement(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceDataProperty(const size_t start,
-                                                    const BinKind kind,
-                                                    const BinFields& fields);
+                                                    const BinASTKind kind,
+                                                    const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceDebuggerStatement(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceDirective(const size_t start,
-                                                 const BinKind kind,
-                                                 const BinFields& fields);
+                                                 const BinASTKind kind,
+                                                 const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceDoWhileStatement(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceEagerArrowExpressionWithExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceEagerArrowExpressionWithFunctionBody(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceEagerFunctionDeclaration(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceEagerFunctionExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceEagerGetter(const size_t start,
-                                                   const BinKind kind,
-                                                   const BinFields& fields);
+                                                   const BinASTKind kind,
+                                                   const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceEagerMethod(const size_t start,
-                                                   const BinKind kind,
-                                                   const BinFields& fields);
+                                                   const BinASTKind kind,
+                                                   const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceEagerSetter(const size_t start,
-                                                   const BinKind kind,
-                                                   const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceEmptyStatement(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
+                                                   const BinASTKind kind,
+                                                   const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceEmptyStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceExpressionStatement(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceForInOfBinding(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceForInStatement(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceForOfStatement(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceForInOfBinding(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceForInStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceForOfStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceForStatement(const size_t start,
-                                                    const BinKind kind,
-                                                    const BinFields& fields);
-  JS::Result<ListNode*> parseInterfaceFormalParameters(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+                                                    const BinASTKind kind,
+                                                    const BinASTFields& fields);
+  JS::Result<ListNode*> parseInterfaceFormalParameters(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<Ok> parseInterfaceFunctionExpressionContents(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut);
   JS::Result<Ok> parseInterfaceFunctionOrMethodContents(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut);
   JS::Result<Ok> parseInterfaceGetterContents(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut);
   JS::Result<ParseNode*> parseInterfaceIdentifierExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceIfStatement(const size_t start,
-                                                   const BinKind kind,
-                                                   const BinFields& fields);
+                                                   const BinASTKind kind,
+                                                   const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLabelledStatement(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLazyArrowExpressionWithExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLazyArrowExpressionWithFunctionBody(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLazyFunctionDeclaration(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLazyFunctionExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLazyGetter(const size_t start,
-                                                  const BinKind kind,
-                                                  const BinFields& fields);
+                                                  const BinASTKind kind,
+                                                  const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLazyMethod(const size_t start,
-                                                  const BinKind kind,
-                                                  const BinFields& fields);
+                                                  const BinASTKind kind,
+                                                  const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLazySetter(const size_t start,
-                                                  const BinKind kind,
-                                                  const BinFields& fields);
+                                                  const BinASTKind kind,
+                                                  const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLiteralBooleanExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLiteralInfinityExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLiteralNullExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLiteralNumericExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLiteralPropertyName(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLiteralRegExpExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLiteralStringExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceModule(const size_t start,
-                                              const BinKind kind,
-                                              const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceNewExpression(const size_t start,
-                                                     const BinKind kind,
-                                                     const BinFields& fields);
+                                              const BinASTKind kind,
+                                              const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceNewExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceNewTargetExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceObjectAssignmentTarget(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceObjectBinding(const size_t start,
-                                                     const BinKind kind,
-                                                     const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceObjectBinding(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceObjectExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceReturnStatement(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceReturnStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceScript(const size_t start,
-                                              const BinKind kind,
-                                              const BinFields& fields);
+                                              const BinASTKind kind,
+                                              const BinASTFields& fields);
   JS::Result<Ok> parseInterfaceSetterContents(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut);
   JS::Result<ParseNode*> parseInterfaceShorthandProperty(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceSpreadElement(const size_t start,
-                                                     const BinKind kind,
-                                                     const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceSpreadElement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceStaticMemberAssignmentTarget(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceStaticMemberExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceSuper(const size_t start,
-                                             const BinKind kind,
-                                             const BinFields& fields);
+                                             const BinASTKind kind,
+                                             const BinASTFields& fields);
   JS::Result<CaseClause*> parseInterfaceSwitchCase(const size_t start,
-                                                   const BinKind kind,
-                                                   const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceSwitchDefault(const size_t start,
-                                                     const BinKind kind,
-                                                     const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceSwitchStatement(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+                                                   const BinASTKind kind,
+                                                   const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceSwitchDefault(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceSwitchStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceSwitchStatementWithDefault(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceTemplateExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceThisExpression(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceThrowStatement(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceThisExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceThrowStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceTryCatchStatement(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceTryFinallyStatement(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceUnaryExpression(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceUnaryExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceUpdateExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceVariableDeclaration(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceVariableDeclarator(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceWhileStatement(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceWithStatement(const size_t start,
-                                                     const BinKind kind,
-                                                     const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceYieldExpression(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceWhileStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceWithStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceYieldExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceYieldStarExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
 
   // ----- String enums (by lexicographical order)
   JS::Result<typename BinASTParser<Tok>::AssertedDeclaredKind>
   parseAssertedDeclaredKind();
   JS::Result<typename BinASTParser<Tok>::BinaryOperator> parseBinaryOperator();
   JS::Result<typename BinASTParser<Tok>::CompoundAssignmentOperator>
   parseCompoundAssignmentOperator();
   JS::Result<typename BinASTParser<Tok>::UnaryOperator> parseUnaryOperator();
--- a/js/src/frontend/BinASTParserPerTokenizer.cpp
+++ b/js/src/frontend/BinASTParserPerTokenizer.cpp
@@ -192,19 +192,19 @@ JS::Result<FunctionNode*> BinASTParserPe
   auto parseFunc = isExpr ? &FinalParser::parseFunctionExpressionContents
                           : &FinalParser::parseFunctionOrMethodContents;
   MOZ_TRY((asFinalParser()->*parseFunc)(func->nargs(), &params, &tmpBody));
 
   BINJS_TRY_DECL(lexicalScopeData,
                  NewLexicalScopeData(cx_, lexicalScope, alloc_, pc_));
   BINJS_TRY_DECL(body, handler_.newLexicalScope(*lexicalScopeData, tmpBody));
 
-  auto binKind = isExpr ? BinKind::LazyFunctionExpression
-                        : BinKind::LazyFunctionDeclaration;
-  return buildFunction(firstOffset, binKind, nullptr, params, body);
+  auto binASTKind = isExpr ? BinASTKind::LazyFunctionExpression
+                           : BinASTKind::LazyFunctionDeclaration;
+  return buildFunction(firstOffset, binASTKind, nullptr, params, body);
 }
 
 template <typename Tok>
 void BinASTParserPerTokenizer<Tok>::forceStrictIfNecessary(
     SharedContext* sc, ListNode* directives) {
   JSAtom* useStrict = cx_->names().useStrict;
 
   for (const ParseNode* directive : directives->contents()) {
@@ -270,63 +270,63 @@ JS::Result<FunctionBox*> BinASTParserPer
   if (pc_) {
     funbox->initWithEnclosingParseContext(pc_, syntax);
   } else {
     funbox->initFromLazyFunction();
   }
   return funbox;
 }
 
-FunctionSyntaxKind BinKindToFunctionSyntaxKind(const BinKind kind) {
+FunctionSyntaxKind BinASTKindToFunctionSyntaxKind(const BinASTKind kind) {
   // FIXME: this doesn't cover FunctionSyntaxKind::ClassConstructor and
   // FunctionSyntaxKind::DerivedClassConstructor.
   switch (kind) {
-    case BinKind::EagerFunctionDeclaration:
-    case BinKind::LazyFunctionDeclaration:
+    case BinASTKind::EagerFunctionDeclaration:
+    case BinASTKind::LazyFunctionDeclaration:
       return FunctionSyntaxKind::Statement;
-    case BinKind::EagerFunctionExpression:
-    case BinKind::LazyFunctionExpression:
+    case BinASTKind::EagerFunctionExpression:
+    case BinASTKind::LazyFunctionExpression:
       return FunctionSyntaxKind::Expression;
-    case BinKind::EagerArrowExpressionWithFunctionBody:
-    case BinKind::LazyArrowExpressionWithFunctionBody:
-    case BinKind::EagerArrowExpressionWithExpression:
-    case BinKind::LazyArrowExpressionWithExpression:
+    case BinASTKind::EagerArrowExpressionWithFunctionBody:
+    case BinASTKind::LazyArrowExpressionWithFunctionBody:
+    case BinASTKind::EagerArrowExpressionWithExpression:
+    case BinASTKind::LazyArrowExpressionWithExpression:
       return FunctionSyntaxKind::Arrow;
-    case BinKind::EagerMethod:
-    case BinKind::LazyMethod:
+    case BinASTKind::EagerMethod:
+    case BinASTKind::LazyMethod:
       return FunctionSyntaxKind::Method;
-    case BinKind::EagerGetter:
-    case BinKind::LazyGetter:
+    case BinASTKind::EagerGetter:
+    case BinASTKind::LazyGetter:
       return FunctionSyntaxKind::Getter;
-    case BinKind::EagerSetter:
-    case BinKind::LazySetter:
+    case BinASTKind::EagerSetter:
+    case BinASTKind::LazySetter:
       return FunctionSyntaxKind::Setter;
     default:
       MOZ_CRASH("Invalid/ kind");
   }
 }
 
 template <typename Tok>
 JS::Result<FunctionNode*> BinASTParserPerTokenizer<Tok>::makeEmptyFunctionNode(
-    const size_t start, const BinKind kind, FunctionBox* funbox) {
+    const size_t start, const BinASTKind kind, FunctionBox* funbox) {
   // LazyScript compilation requires basically none of the fields filled out.
   TokenPos pos = tokenizer_->pos(start);
-  FunctionSyntaxKind syntaxKind = BinKindToFunctionSyntaxKind(kind);
+  FunctionSyntaxKind syntaxKind = BinASTKindToFunctionSyntaxKind(kind);
 
   BINJS_TRY_DECL(result, handler_.newFunction(syntaxKind, pos));
 
   handler_.setFunctionBox(result, funbox);
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<FunctionNode*> BinASTParserPerTokenizer<Tok>::buildFunction(
-    const size_t start, const BinKind kind, ParseNode* name, ListNode* params,
-    ParseNode* body) {
+    const size_t start, const BinASTKind kind, ParseNode* name,
+    ListNode* params, ParseNode* body) {
   FunctionBox* funbox = pc_->functionBox();
 
   // Set the argument count for building argument packets. Function.length is
   // handled by setting the appropriate funbox field during argument parsing.
   if (!lazyScript_ ||
       lazyScript_->functionNonDelazifying() != funbox->function()) {
     funbox->function()->setArgCount(params ? uint16_t(params->count()) : 0);
   }
@@ -678,44 +678,44 @@ template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseMissingDirectEvalInAssertedScope() {
   return raiseError("Direct call to `eval` was not declared in AssertedScope");
 }
 
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseInvalidKind(const char* superKind,
-                                                const BinKind kind) {
+                                                const BinASTKind kind) {
   Sprinter out(cx_);
   BINJS_TRY(out.init());
-  BINJS_TRY(
-      out.printf("In %s, invalid kind %s", superKind, describeBinKind(kind)));
+  BINJS_TRY(out.printf("In %s, invalid kind %s", superKind,
+                       describeBinASTKind(kind)));
   return raiseError(out.string());
 }
 
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseInvalidVariant(const char* kind,
-                                                   const BinVariant value) {
+                                                   const BinASTVariant value) {
   Sprinter out(cx_);
   BINJS_TRY(out.init());
   BINJS_TRY(out.printf("In %s, invalid variant '%s'", kind,
-                       describeBinVariant(value)));
+                       describeBinASTVariant(value)));
 
   return raiseError(out.string());
 }
 
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseMissingField(const char* kind,
-                                                 const BinField field) {
+                                                 const BinASTField field) {
   Sprinter out(cx_);
   BINJS_TRY(out.init());
-  BINJS_TRY(
-      out.printf("In %s, missing field '%s'", kind, describeBinField(field)));
+  BINJS_TRY(out.printf("In %s, missing field '%s'", kind,
+                       describeBinASTField(field)));
 
   return raiseError(out.string());
 }
 
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseEmpty(const char* description) {
   Sprinter out(cx_);
@@ -728,21 +728,21 @@ BinASTParserPerTokenizer<Tok>::raiseEmpt
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseOOM() {
   return tokenizer_->raiseOOM();
 }
 
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
-BinASTParserPerTokenizer<Tok>::raiseError(BinKind kind,
+BinASTParserPerTokenizer<Tok>::raiseError(BinASTKind kind,
                                           const char* description) {
   Sprinter out(cx_);
   BINJS_TRY(out.init());
-  BINJS_TRY(out.printf("In %s, %s", describeBinKind(kind), description));
+  BINJS_TRY(out.printf("In %s, %s", describeBinASTKind(kind), description));
   return tokenizer_->raiseError(out.string());
 }
 
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseError(const char* description) {
   return tokenizer_->raiseError(description);
 }
--- a/js/src/frontend/BinASTParserPerTokenizer.h
+++ b/js/src/frontend/BinASTParserPerTokenizer.h
@@ -49,17 +49,17 @@ template <typename Tok>
 class BinASTParserPerTokenizer : public BinASTParserBase,
                                  public ErrorReporter,
                                  public BCEParserHandle {
  public:
   using Tokenizer = Tok;
 
   using AutoList = typename Tokenizer::AutoList;
   using AutoTaggedTuple = typename Tokenizer::AutoTaggedTuple;
-  using BinFields = typename Tokenizer::BinFields;
+  using BinASTFields = typename Tokenizer::BinASTFields;
   using Chars = typename Tokenizer::Chars;
 
  public:
   // Auto-generated types.
   using AssertedDeclaredKind = binast::AssertedDeclaredKind;
   using VariableDeclarationKind = binast::VariableDeclarationKind;
 
  public:
@@ -101,28 +101,28 @@ class BinASTParserPerTokenizer : public 
 
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseInvalidClosedVar(
       JSAtom* name);
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&>
   raiseMissingVariableInAssertedScope(JSAtom* name);
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&>
   raiseMissingDirectEvalInAssertedScope();
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseInvalidKind(
-      const char* superKind, const BinKind kind);
+      const char* superKind, const BinASTKind kind);
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseInvalidVariant(
-      const char* kind, const BinVariant value);
+      const char* kind, const BinASTVariant value);
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseMissingField(
-      const char* kind, const BinField field);
+      const char* kind, const BinASTField field);
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseEmpty(
       const char* description);
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseOOM();
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseError(
       const char* description);
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseError(
-      BinKind kind, const char* description);
+      BinASTKind kind, const char* description);
 
   // Ensure that this parser will never be used again.
   void poison();
 
   // The owner or the target of Asserted*Scope.
   enum class AssertedScopeKind {
     Block,
     Catch,
@@ -131,22 +131,23 @@ class BinASTParserPerTokenizer : public 
     Var,
   };
 
   // --- Auxiliary parsing functions
 
   // Build a function object for a function-producing production. Called AFTER
   // creating the scope.
   JS::Result<FunctionNode*> makeEmptyFunctionNode(const size_t start,
-                                                  const BinKind kind,
+                                                  const BinASTKind kind,
                                                   FunctionBox* funbox);
 
   JS::Result<FunctionNode*> buildFunction(const size_t start,
-                                          const BinKind kind, ParseNode* name,
-                                          ListNode* params, ParseNode* body);
+                                          const BinASTKind kind,
+                                          ParseNode* name, ListNode* params,
+                                          ParseNode* body);
   JS::Result<FunctionBox*> buildFunctionBox(GeneratorKind generatorKind,
                                             FunctionAsyncKind functionAsyncKind,
                                             FunctionSyntaxKind syntax,
                                             ParseNode* name);
 
   // Add name to a given scope.
   MOZ_MUST_USE JS::Result<Ok> addScopeName(
       AssertedScopeKind scopeKind, HandleAtom name, ParseContext::Scope* scope,
--- a/js/src/frontend/BinASTRuntimeSupport.cpp
+++ b/js/src/frontend/BinASTRuntimeSupport.cpp
@@ -10,28 +10,28 @@
 #include "js/Vector.h"
 #include "vm/StringType.h"
 
 namespace js {
 namespace frontend {
 
 /* static */
 BinASTSourceMetadata* BinASTSourceMetadata::Create(
-    const Vector<BinKind>& binKinds, uint32_t numStrings) {
-  uint32_t numBinKinds = binKinds.length();
+    const Vector<BinASTKind>& binASTKinds, uint32_t numStrings) {
+  uint32_t numBinASTKinds = binASTKinds.length();
 
   BinASTSourceMetadata* data = static_cast<BinASTSourceMetadata*>(
-      js_malloc(BinASTSourceMetadata::totalSize(numBinKinds, numStrings)));
+      js_malloc(BinASTSourceMetadata::totalSize(numBinASTKinds, numStrings)));
   if (!data) {
     return nullptr;
   }
 
-  new (data) BinASTSourceMetadata(numBinKinds, numStrings);
-  memcpy(data->binKindBase(), binKinds.begin(),
-         binKinds.length() * sizeof(BinKind));
+  new (data) BinASTSourceMetadata(numBinASTKinds, numStrings);
+  memcpy(data->binASTKindBase(), binASTKinds.begin(),
+         binASTKinds.length() * sizeof(BinASTKind));
 
   return data;
 }
 
 void BinASTSourceMetadata::trace(JSTracer* tracer) {
   JSAtom** base = atomsBase();
   for (uint32_t i = 0; i < numStrings_; i++) {
     if (base[i]) {
--- a/js/src/frontend/BinASTRuntimeSupport.h
+++ b/js/src/frontend/BinASTRuntimeSupport.h
@@ -19,19 +19,19 @@
 #include "js/Vector.h"
 
 namespace js {
 
 class ScriptSource;
 
 // Support for parsing JS Binary ASTs.
 struct BinaryASTSupport {
-  using BinVariant = js::frontend::BinVariant;
-  using BinField = js::frontend::BinField;
-  using BinKind = js::frontend::BinKind;
+  using BinASTVariant = js::frontend::BinASTVariant;
+  using BinASTField = js::frontend::BinASTField;
+  using BinASTKind = js::frontend::BinASTKind;
 
   // A structure designed to perform fast char* + length lookup
   // without copies.
   struct CharSlice {
     const char* start_;
     uint32_t byteLen_;
     CharSlice(const CharSlice& other)
         : start_(other.start_), byteLen_(other.byteLen_) {}
@@ -59,84 +59,85 @@ struct BinaryASTSupport {
         return false;
       }
       return strncmp(key.start_, lookup.start_, key.byteLen_) == 0;
     }
   };
 
   BinaryASTSupport();
 
-  JS::Result<const BinVariant*> binVariant(JSContext*, const CharSlice);
-  JS::Result<const BinKind*> binKind(JSContext*, const CharSlice);
+  JS::Result<const BinASTVariant*> binASTVariant(JSContext*, const CharSlice);
+  JS::Result<const BinASTKind*> binASTKind(JSContext*, const CharSlice);
 
   bool ensureBinTablesInitialized(JSContext*);
 
  private:
-  bool ensureBinKindsInitialized(JSContext*);
-  bool ensureBinVariantsInitialized(JSContext*);
+  bool ensureBinASTKindsInitialized(JSContext*);
+  bool ensureBinASTVariantsInitialized(JSContext*);
 
  private:
   // A HashMap that can be queried without copies from a CharSlice key.
   // Initialized on first call. Keys are CharSlices into static strings.
-  using BinKindMap =
-      js::HashMap<const CharSlice, BinKind, CharSlice, js::SystemAllocPolicy>;
-  BinKindMap binKindMap_;
+  using BinASTKindMap = js::HashMap<const CharSlice, BinASTKind, CharSlice,
+                                    js::SystemAllocPolicy>;
+  BinASTKindMap binASTKindMap_;
 
-  using BinFieldMap =
-      js::HashMap<const CharSlice, BinField, CharSlice, js::SystemAllocPolicy>;
-  BinFieldMap binFieldMap_;
+  using BinASTFieldMap = js::HashMap<const CharSlice, BinASTField, CharSlice,
+                                     js::SystemAllocPolicy>;
+  BinASTFieldMap binASTFieldMap_;
 
-  using BinVariantMap = js::HashMap<const CharSlice, BinVariant, CharSlice,
-                                    js::SystemAllocPolicy>;
-  BinVariantMap binVariantMap_;
+  using BinASTVariantMap = js::HashMap<const CharSlice, BinASTVariant,
+                                       CharSlice, js::SystemAllocPolicy>;
+  BinASTVariantMap binASTVariantMap_;
 };
 
 namespace frontend {
 
 class BinASTSourceMetadata {
   using CharSlice = BinaryASTSupport::CharSlice;
 
   const uint32_t numStrings_;
-  const uint32_t numBinKinds_;
+  const uint32_t numBinASTKinds_;
 
   // The data lives inline in the allocation, after this class.
   inline JSAtom** atomsBase() {
     return reinterpret_cast<JSAtom**>(reinterpret_cast<uintptr_t>(this + 1));
   }
   inline CharSlice* sliceBase() {
     return reinterpret_cast<CharSlice*>(
         reinterpret_cast<uintptr_t>(atomsBase()) +
         numStrings_ * sizeof(JSAtom*));
   }
-  inline BinKind* binKindBase() {
-    return reinterpret_cast<BinKind*>(reinterpret_cast<uintptr_t>(sliceBase()) +
-                                      numStrings_ * sizeof(CharSlice));
+  inline BinASTKind* binASTKindBase() {
+    return reinterpret_cast<BinASTKind*>(
+        reinterpret_cast<uintptr_t>(sliceBase()) +
+        numStrings_ * sizeof(CharSlice));
   }
 
-  static inline size_t totalSize(uint32_t numBinKinds, uint32_t numStrings) {
+  static inline size_t totalSize(uint32_t numBinASTKinds, uint32_t numStrings) {
     return sizeof(BinASTSourceMetadata) + numStrings * sizeof(JSAtom*) +
-           numStrings * sizeof(CharSlice) + numBinKinds * sizeof(BinKind);
+           numStrings * sizeof(CharSlice) + numBinASTKinds * sizeof(BinASTKind);
   }
 
-  BinASTSourceMetadata(uint32_t numBinKinds, uint32_t numStrings)
-      : numStrings_(numStrings), numBinKinds_(numBinKinds) {}
+  BinASTSourceMetadata(uint32_t numBinASTKinds, uint32_t numStrings)
+      : numStrings_(numStrings), numBinASTKinds_(numBinASTKinds) {}
 
   friend class js::ScriptSource;
 
  public:
-  static BinASTSourceMetadata* Create(const Vector<BinKind>& binKinds,
+  static BinASTSourceMetadata* Create(const Vector<BinASTKind>& binASTKinds,
                                       uint32_t numStrings);
 
-  inline uint32_t numBinKinds() { return numBinKinds_; }
+  inline uint32_t numBinASTKinds() { return numBinASTKinds_; }
 
   inline uint32_t numStrings() { return numStrings_; }
 
-  inline BinKind& getBinKind(uint32_t index) {
-    MOZ_ASSERT(index < numBinKinds_);
-    return binKindBase()[index];
+  inline BinASTKind& getBinASTKind(uint32_t index) {
+    MOZ_ASSERT(index < numBinASTKinds_);
+    return binASTKindBase()[index];
   }
 
   inline CharSlice& getSlice(uint32_t index) {
     MOZ_ASSERT(index < numStrings_);
     return sliceBase()[index];
   }
 
   inline JSAtom*& getAtom(uint32_t index) {
--- a/js/src/frontend/BinASTToken.cpp
+++ b/js/src/frontend/BinASTToken.cpp
@@ -13,141 +13,143 @@
 #include "frontend/BinASTRuntimeSupport.h"
 #include "frontend/TokenStream.h"
 #include "js/Result.h"
 #include "vm/JSContext.h"
 
 namespace js {
 namespace frontend {
 
-const BinaryASTSupport::CharSlice BINKIND_DESCRIPTIONS[] = {
+const BinaryASTSupport::CharSlice BINASTKIND_DESCRIPTIONS[] = {
 #define WITH_VARIANT(_, SPEC_NAME) \
   BinaryASTSupport::CharSlice(SPEC_NAME, sizeof(SPEC_NAME) - 1),
     FOR_EACH_BIN_KIND(WITH_VARIANT)
 #undef WITH_VARIANT
 };
 
-const BinaryASTSupport::CharSlice BINFIELD_DESCRIPTIONS[] = {
+const BinaryASTSupport::CharSlice BINASTFIELD_DESCRIPTIONS[] = {
 #define WITH_VARIANT(_, SPEC_NAME) \
   BinaryASTSupport::CharSlice(SPEC_NAME, sizeof(SPEC_NAME) - 1),
     FOR_EACH_BIN_FIELD(WITH_VARIANT)
 #undef WITH_VARIANT
 };
 
-const BinaryASTSupport::CharSlice BINVARIANT_DESCRIPTIONS[] = {
+const BinaryASTSupport::CharSlice BINASTVARIANT_DESCRIPTIONS[] = {
 #define WITH_VARIANT(_, SPEC_NAME) \
   BinaryASTSupport::CharSlice(SPEC_NAME, sizeof(SPEC_NAME) - 1),
     FOR_EACH_BIN_VARIANT(WITH_VARIANT)
 #undef WITH_VARIANT
 };
 
-const BinaryASTSupport::CharSlice& getBinKind(const BinKind& variant) {
-  return BINKIND_DESCRIPTIONS[static_cast<size_t>(variant)];
+const BinaryASTSupport::CharSlice& getBinASTKind(const BinASTKind& variant) {
+  return BINASTKIND_DESCRIPTIONS[static_cast<size_t>(variant)];
 }
 
-const BinaryASTSupport::CharSlice& getBinVariant(const BinVariant& variant) {
-  return BINVARIANT_DESCRIPTIONS[static_cast<size_t>(variant)];
+const BinaryASTSupport::CharSlice& getBinASTVariant(
+    const BinASTVariant& variant) {
+  return BINASTVARIANT_DESCRIPTIONS[static_cast<size_t>(variant)];
 }
 
-const BinaryASTSupport::CharSlice& getBinField(const BinField& variant) {
-  return BINFIELD_DESCRIPTIONS[static_cast<size_t>(variant)];
+const BinaryASTSupport::CharSlice& getBinASTField(const BinASTField& variant) {
+  return BINASTFIELD_DESCRIPTIONS[static_cast<size_t>(variant)];
 }
 
-const char* describeBinKind(const BinKind& variant) {
-  return getBinKind(variant).begin();
+const char* describeBinASTKind(const BinASTKind& variant) {
+  return getBinASTKind(variant).begin();
 }
 
-const char* describeBinField(const BinField& variant) {
-  return getBinField(variant).begin();
+const char* describeBinASTField(const BinASTField& variant) {
+  return getBinASTField(variant).begin();
 }
 
-const char* describeBinVariant(const BinVariant& variant) {
-  return getBinVariant(variant).begin();
+const char* describeBinASTVariant(const BinASTVariant& variant) {
+  return getBinASTVariant(variant).begin();
 }
 
 }  // namespace frontend
 
 BinaryASTSupport::BinaryASTSupport()
-    : binKindMap_(frontend::BINKIND_LIMIT),
-      binFieldMap_(frontend::BINFIELD_LIMIT),
-      binVariantMap_(frontend::BINVARIANT_LIMIT) {}
+    : binASTKindMap_(frontend::BINASTKIND_LIMIT),
+      binASTFieldMap_(frontend::BINASTFIELD_LIMIT),
+      binASTVariantMap_(frontend::BINASTVARIANT_LIMIT) {}
 
 /**
  * It is expected that all bin tables are initialized on the main thread, and
  * that any helper threads will find the read-only tables properly initialized,
  * so that they can do their accesses safely without taking any locks.
  */
 bool BinaryASTSupport::ensureBinTablesInitialized(JSContext* cx) {
-  return ensureBinKindsInitialized(cx) && ensureBinVariantsInitialized(cx);
+  return ensureBinASTKindsInitialized(cx) &&
+         ensureBinASTVariantsInitialized(cx);
 }
 
-bool BinaryASTSupport::ensureBinKindsInitialized(JSContext* cx) {
+bool BinaryASTSupport::ensureBinASTKindsInitialized(JSContext* cx) {
   MOZ_ASSERT(!cx->helperThread());
-  if (binKindMap_.empty()) {
-    for (size_t i = 0; i < frontend::BINKIND_LIMIT; ++i) {
-      const BinKind variant = static_cast<BinKind>(i);
-      const CharSlice& key = getBinKind(variant);
-      auto ptr = binKindMap_.lookupForAdd(key);
+  if (binASTKindMap_.empty()) {
+    for (size_t i = 0; i < frontend::BINASTKIND_LIMIT; ++i) {
+      const BinASTKind variant = static_cast<BinASTKind>(i);
+      const CharSlice& key = getBinASTKind(variant);
+      auto ptr = binASTKindMap_.lookupForAdd(key);
       MOZ_ASSERT(!ptr);
-      if (!binKindMap_.add(ptr, key, variant)) {
+      if (!binASTKindMap_.add(ptr, key, variant)) {
         ReportOutOfMemory(cx);
         return false;
       }
     }
   }
 
   return true;
 }
 
-bool BinaryASTSupport::ensureBinVariantsInitialized(JSContext* cx) {
+bool BinaryASTSupport::ensureBinASTVariantsInitialized(JSContext* cx) {
   MOZ_ASSERT(!cx->helperThread());
-  if (binVariantMap_.empty()) {
-    for (size_t i = 0; i < frontend::BINVARIANT_LIMIT; ++i) {
-      const BinVariant variant = static_cast<BinVariant>(i);
-      const CharSlice& key = getBinVariant(variant);
-      auto ptr = binVariantMap_.lookupForAdd(key);
+  if (binASTVariantMap_.empty()) {
+    for (size_t i = 0; i < frontend::BINASTVARIANT_LIMIT; ++i) {
+      const BinASTVariant variant = static_cast<BinASTVariant>(i);
+      const CharSlice& key = getBinASTVariant(variant);
+      auto ptr = binASTVariantMap_.lookupForAdd(key);
       MOZ_ASSERT(!ptr);
-      if (!binVariantMap_.add(ptr, key, variant)) {
+      if (!binASTVariantMap_.add(ptr, key, variant)) {
         ReportOutOfMemory(cx);
         return false;
       }
     }
   }
   return true;
 }
 
-JS::Result<const js::frontend::BinKind*> BinaryASTSupport::binKind(
+JS::Result<const js::frontend::BinASTKind*> BinaryASTSupport::binASTKind(
     JSContext* cx, const CharSlice key) {
-  MOZ_ASSERT_IF(cx->helperThread(), !binKindMap_.empty());
+  MOZ_ASSERT_IF(cx->helperThread(), !binASTKindMap_.empty());
   if (!cx->helperThread()) {
     // Initialize Lazily if on main thread.
-    if (!ensureBinKindsInitialized(cx)) {
+    if (!ensureBinASTKindsInitialized(cx)) {
       return cx->alreadyReportedError();
     }
   }
 
-  auto ptr = binKindMap_.readonlyThreadsafeLookup(key);
+  auto ptr = binASTKindMap_.readonlyThreadsafeLookup(key);
   if (!ptr) {
     return nullptr;
   }
 
   return &ptr->value();
 }
 
-JS::Result<const js::frontend::BinVariant*> BinaryASTSupport::binVariant(
+JS::Result<const js::frontend::BinASTVariant*> BinaryASTSupport::binASTVariant(
     JSContext* cx, const CharSlice key) {
-  MOZ_ASSERT_IF(cx->helperThread(), !binVariantMap_.empty());
+  MOZ_ASSERT_IF(cx->helperThread(), !binASTVariantMap_.empty());
   if (!cx->helperThread()) {
     // Initialize lazily if on main thread.
-    if (!ensureBinVariantsInitialized(cx)) {
+    if (!ensureBinASTVariantsInitialized(cx)) {
       return cx->alreadyReportedError();
     }
   }
 
-  auto ptr = binVariantMap_.readonlyThreadsafeLookup(key);
+  auto ptr = binASTVariantMap_.readonlyThreadsafeLookup(key);
   if (!ptr) {
     return nullptr;
   }
 
   return &ptr->value();
 }
 
 }  // namespace js
--- a/js/src/frontend/BinASTToken.h
+++ b/js/src/frontend/BinASTToken.h
@@ -14,19 +14,19 @@
 
 #include <stddef.h>
 
 /**
  * Definition of Binary AST tokens.
  *
  * In the Binary AST world, an AST is composed of nodes, where a node is
  * defined by:
- * - a Kind (see `BinKind`);
+ * - a Kind (see `BinASTKind`);
  * - a list of fields, where each field is:
- *    - a Name (see `BinField`);
+ *    - a Name (see `BinASTField`);
  *    - a Value, which may be either a node or a primitive value.
  *
  * The mapping between Kind and list of fields is determined entirely by
  * the grammar of Binary AST. The mapping between (Kind, Name) and the
  * structure of Value is also determined entirely by the grammar of
  * Binary AST.
  *
  * As per the specifications of Binary AST, kinds may be added as the
@@ -180,24 +180,24 @@ namespace frontend {
   F(UpdateExpression, "UpdateExpression")                                     \
   F(VariableDeclaration, "VariableDeclaration")                               \
   F(VariableDeclarator, "VariableDeclarator")                                 \
   F(WhileStatement, "WhileStatement")                                         \
   F(WithStatement, "WithStatement")                                           \
   F(YieldExpression, "YieldExpression")                                       \
   F(YieldStarExpression, "YieldStarExpression")
 
-enum class BinKind {
+enum class BinASTKind {
 #define EMIT_ENUM(name, _) name,
   FOR_EACH_BIN_KIND(EMIT_ENUM)
 #undef EMIT_ENUM
 };
 
-// The number of distinct values of BinKind.
-const size_t BINKIND_LIMIT = 120;
+// The number of distinct values of BinASTKind.
+const size_t BINASTKIND_LIMIT = 120;
 
 /**
  * The different fields of Binary AST nodes, as per the specifications of
  * Binary AST.
  *
  * Usage:
  *
  * ```c++
@@ -273,24 +273,24 @@ const size_t BINKIND_LIMIT = 120;
   F(Scope, "scope")                                   \
   F(Statements, "statements")                         \
   F(Super, "super")                                   \
   F(Tag, "tag")                                       \
   F(Test, "test")                                     \
   F(Update, "update")                                 \
   F(Value, "value")
 
-enum class BinField {
+enum class BinASTField {
 #define EMIT_ENUM(name, _) name,
   FOR_EACH_BIN_FIELD(EMIT_ENUM)
 #undef EMIT_ENUM
 };
 
-// The number of distinct values of BinField.
-const size_t BINFIELD_LIMIT = 69;
+// The number of distinct values of BinASTField.
+const size_t BINASTFIELD_LIMIT = 69;
 
 /**
  * The different variants of Binary AST string enums, as per
  * the specifications of Binary AST, as a single macro and
  * `enum class`.
  *
  * Separate enum classes are also defined in BinASTParser.h.
  *
@@ -349,36 +349,36 @@ const size_t BINFIELD_LIMIT = 69;
   F(UnaryOperatorNot, "!")                                    \
   F(UnaryOperatorTypeof, "typeof")                            \
   F(UnaryOperatorVoid, "void")                                \
   F(UpdateOperatorDecr, "--")                                 \
   F(UpdateOperatorIncr, "++")                                 \
   F(VariableDeclarationKindConst, "const")                    \
   F(VariableDeclarationKindLet, "let")
 
-enum class BinVariant {
+enum class BinASTVariant {
 #define EMIT_ENUM(name, _) name,
   FOR_EACH_BIN_VARIANT(EMIT_ENUM)
 #undef EMIT_ENUM
 };
 
-// The number of distinct values of BinVariant.
-const size_t BINVARIANT_LIMIT = 49;
+// The number of distinct values of BinASTVariant.
+const size_t BINASTVARIANT_LIMIT = 49;
 
 /**
- * Return a string describing a `BinKind`.
+ * Return a string describing a `BinASTKind`.
  */
-const char* describeBinKind(const BinKind& kind);
+const char* describeBinASTKind(const BinASTKind& kind);
 
 /**
- * Return a string describing a `BinField`.
+ * Return a string describing a `BinASTField`.
  */
-const char* describeBinField(const BinField& kind);
+const char* describeBinASTField(const BinASTField& kind);
 
 /**
- * Return a string describing a `BinVariant`.
+ * Return a string describing a `BinASTVariant`.
  */
-const char* describeBinVariant(const BinVariant& kind);
+const char* describeBinASTVariant(const BinASTVariant& kind);
 
 }  // namespace frontend
 }  // namespace js
 
 #endif  // frontend_BinASTToken_h
--- a/js/src/frontend/BinASTTokenReaderBase.cpp
+++ b/js/src/frontend/BinASTTokenReaderBase.cpp
@@ -34,30 +34,30 @@ ErrorResult<JS::Error&> BinASTTokenReade
 }
 
 ErrorResult<JS::Error&> BinASTTokenReaderBase::raiseOOM() {
   ReportOutOfMemory(cx_);
   return cx_->alreadyReportedError();
 }
 
 ErrorResult<JS::Error&> BinASTTokenReaderBase::raiseInvalidNumberOfFields(
-    const BinKind kind, const uint32_t expected, const uint32_t got) {
+    const BinASTKind kind, const uint32_t expected, const uint32_t got) {
   Sprinter out(cx_);
   BINJS_TRY(out.init());
   BINJS_TRY(out.printf("In %s, invalid number of fields: expected %u, got %u",
-                       describeBinKind(kind), expected, got));
+                       describeBinASTKind(kind), expected, got));
   return raiseError(out.string());
 }
 
 ErrorResult<JS::Error&> BinASTTokenReaderBase::raiseInvalidField(
-    const char* kind, const BinField field) {
+    const char* kind, const BinASTField field) {
   Sprinter out(cx_);
   BINJS_TRY(out.init());
-  BINJS_TRY(
-      out.printf("In %s, invalid field '%s'", kind, describeBinField(field)));
+  BINJS_TRY(out.printf("In %s, invalid field '%s'", kind,
+                       describeBinASTField(field)));
   return raiseError(out.string());
 }
 
 bool BinASTTokenReaderBase::hasRaisedError() const {
   if (cx_->helperThread()) {
     // When performing off-main-thread parsing, we don't set a pending
     // exception but instead add a pending compile error.
     return cx_->isCompileErrorPending();
--- a/js/src/frontend/BinASTTokenReaderBase.h
+++ b/js/src/frontend/BinASTTokenReaderBase.h
@@ -62,19 +62,19 @@ class MOZ_STACK_CLASS BinASTTokenReaderB
   /**
    * Raise an error.
    *
    * Once `raiseError` has been called, the tokenizer is poisoned.
    */
   MOZ_MUST_USE ErrorResult<JS::Error&> raiseError(const char* description);
   MOZ_MUST_USE ErrorResult<JS::Error&> raiseOOM();
   MOZ_MUST_USE ErrorResult<JS::Error&> raiseInvalidNumberOfFields(
-      const BinKind kind, const uint32_t expected, const uint32_t got);
-  MOZ_MUST_USE ErrorResult<JS::Error&> raiseInvalidField(const char* kind,
-                                                         const BinField field);
+      const BinASTKind kind, const uint32_t expected, const uint32_t got);
+  MOZ_MUST_USE ErrorResult<JS::Error&> raiseInvalidField(
+      const char* kind, const BinASTField field);
 
  protected:
   BinASTTokenReaderBase(JSContext* cx, ErrorReporter* er, const uint8_t* start,
                         const size_t length)
       : cx_(cx),
         errorReporter_(er),
         poisoned_(false),
         start_(start),
--- a/js/src/frontend/BinASTTokenReaderMultipart.cpp
+++ b/js/src/frontend/BinASTTokenReaderMultipart.cpp
@@ -98,39 +98,39 @@ JS::Result<Ok> BinASTTokenReaderMultipar
   const auto posBeforeGrammar = current_;
 
   if (posBeforeGrammar + grammarByteLen > stop_ ||
       posBeforeGrammar + grammarByteLen < current_) {  // Sanity check.
     return raiseError("Invalid byte length in grammar table");
   }
 
   BINJS_MOZ_TRY_DECL(grammarNumberOfEntries, readInternalUint32());
-  if (grammarNumberOfEntries > BINKIND_LIMIT) {  // Sanity check.
+  if (grammarNumberOfEntries > BINASTKIND_LIMIT) {  // Sanity check.
     return raiseError("Invalid number of entries in grammar table");
   }
 
-  // This table maps BinKind index -> BinKind.
+  // This table maps BinASTKind index -> BinASTKind.
   // Initialize and populate.
-  Vector<BinKind> grammarTable_(cx_);
+  Vector<BinASTKind> grammarTable_(cx_);
   if (!grammarTable_.reserve(grammarNumberOfEntries)) {
     return raiseOOM();
   }
 
   for (uint32_t i = 0; i < grammarNumberOfEntries; ++i) {
     BINJS_MOZ_TRY_DECL(byteLen, readInternalUint32());
     if (current_ + byteLen > stop_) {
       return raiseError("Invalid byte length in grammar table");
     }
     if (current_ + byteLen < current_) {  // Overflow.
       return raiseError("Invalid byte length in grammar table");
     }
     CharSlice name((const char*)current_, byteLen);
     current_ += byteLen;
 
-    BINJS_MOZ_TRY_DECL(kind, cx_->runtime()->binast().binKind(cx_, name));
+    BINJS_MOZ_TRY_DECL(kind, cx_->runtime()->binast().binASTKind(cx_, name));
     if (!kind) {
       return raiseError("Invalid entry in grammar table");
     }
 
     grammarTable_.infallibleAppend(
         *kind);  // We called `reserve` before the loop.
   }
   if (current_ != grammarByteLen + posBeforeGrammar) {
@@ -315,17 +315,17 @@ JS::Result<Ok> BinASTTokenReaderMultipar
   if (index >= metadata_->numStrings()) {
     return raiseError("Invalid index to strings table for string enum");
   }
 
   out = metadata_->getSlice(index);
   return Ok();
 }
 
-JS::Result<BinVariant> BinASTTokenReaderMultipart::readVariant() {
+JS::Result<BinASTVariant> BinASTTokenReaderMultipart::readVariant() {
   updateLatestKnownGood();
   BINJS_MOZ_TRY_DECL(index, readInternalUint32());
 
   if (index >= metadata_->numStrings()) {
     return raiseError("Invalid index to strings table for string enum");
   }
 
   auto variantsPtr = variantsTable_.lookupForAdd(index);
@@ -335,17 +335,18 @@ JS::Result<BinVariant> BinASTTokenReader
 
   // Either we haven't cached the result yet or this is not a variant.
   // Check in the slices table and, in case of success, cache the result.
 
   // Note that we stop parsing if we attempt to readVariant() with an
   // ill-formed variant, so we don't run the risk of feching an ill-variant
   // more than once.
   Chars slice = metadata_->getSlice(index);  // We have checked `index` above.
-  BINJS_MOZ_TRY_DECL(variant, cx_->runtime()->binast().binVariant(cx_, slice));
+  BINJS_MOZ_TRY_DECL(variant,
+                     cx_->runtime()->binast().binASTVariant(cx_, slice));
 
   if (!variant) {
     return raiseError("Invalid string enum variant");
   }
 
   if (!variantsTable_.add(variantsPtr, index, *variant)) {
     return raiseOOM();
   }
@@ -368,24 +369,24 @@ BinASTTokenReaderMultipart::readSkippabl
 
   return BinASTTokenReaderBase::SkippableSubTree(start, byteLen);
 }
 
 // Tagged tuples:
 // - uint32_t index in table [grammar];
 // - content (specified by the higher-level grammar);
 JS::Result<Ok> BinASTTokenReaderMultipart::enterTaggedTuple(
-    BinKind& tag, BinASTTokenReaderMultipart::BinFields&,
+    BinASTKind& tag, BinASTTokenReaderMultipart::BinASTFields&,
     AutoTaggedTuple& guard) {
   BINJS_MOZ_TRY_DECL(index, readInternalUint32());
-  if (index >= metadata_->numBinKinds()) {
+  if (index >= metadata_->numBinASTKinds()) {
     return raiseError("Invalid index to grammar table");
   }
 
-  tag = metadata_->getBinKind(index);
+  tag = metadata_->getBinASTKind(index);
 
   // Enter the body.
   guard.init();
   return Ok();
 }
 
 // List:
 //
--- a/js/src/frontend/BinASTTokenReaderMultipart.h
+++ b/js/src/frontend/BinASTTokenReaderMultipart.h
@@ -33,21 +33,21 @@ namespace frontend {
 class MOZ_STACK_CLASS BinASTTokenReaderMultipart
     : public BinASTTokenReaderBase {
  public:
   class AutoList;
   class AutoTaggedTuple;
 
   using CharSlice = BinaryASTSupport::CharSlice;
 
-  // This implementation of `BinFields` is effectively `void`, as the format
+  // This implementation of `BinASTFields` is effectively `void`, as the format
   // does not embed field information.
-  class BinFields {
+  class BinASTFields {
    public:
-    explicit BinFields(JSContext*) {}
+    explicit BinASTFields(JSContext*) {}
   };
   using Chars = CharSlice;
 
  public:
   /**
    * Construct a token reader.
    *
    * Does NOT copy the buffer.
@@ -113,20 +113,20 @@ class MOZ_STACK_CLASS BinASTTokenReaderM
   /**
    * Read a single `string | null` value.
    *
    * MAY check if that string is not valid UTF-8.
    */
   MOZ_MUST_USE JS::Result<Ok> readChars(Chars&);
 
   /**
-   * Read a single `BinVariant | null` value.
+   * Read a single `BinASTVariant | null` value.
    */
-  MOZ_MUST_USE JS::Result<mozilla::Maybe<BinVariant>> readMaybeVariant();
-  MOZ_MUST_USE JS::Result<BinVariant> readVariant();
+  MOZ_MUST_USE JS::Result<mozilla::Maybe<BinASTVariant>> readMaybeVariant();
+  MOZ_MUST_USE JS::Result<BinASTVariant> readVariant();
 
   /**
    * Read over a single `[Skippable]` subtree value.
    *
    * This does *not* attempt to parse the subtree itself. Rather, the
    * returned `SkippableSubTree` contains the necessary information
    * to parse/tokenize the subtree at a later stage
    */
@@ -166,36 +166,37 @@ class MOZ_STACK_CLASS BinASTTokenReaderM
    * exactly all the bytes from that tuple. The `guard` MUST therefore be
    * destroyed at the point where the caller has reached the end of the tuple.
    * If the caller has consumed too few/too many bytes, this will be reported
    * in the call go `guard.done()`.
    *
    * @return out If the header of the tuple is invalid.
    */
   MOZ_MUST_USE JS::Result<Ok> enterTaggedTuple(
-      BinKind& tag, BinASTTokenReaderMultipart::BinFields& fields,
+      BinASTKind& tag, BinASTTokenReaderMultipart::BinASTFields& fields,
       AutoTaggedTuple& guard);
 
   /**
    * Read a single unsigned long.
    */
   MOZ_MUST_USE JS::Result<uint32_t> readUnsignedLong() {
     return readInternalUint32();
   }
 
  private:
   /**
    * Read a single uint32_t.
    */
   MOZ_MUST_USE JS::Result<uint32_t> readInternalUint32();
 
  private:
-  // A mapping string index => BinVariant as extracted from the [STRINGS]
+  // A mapping string index => BinASTVariant as extracted from the [STRINGS]
   // section of the file. Populated lazily.
-  js::HashMap<uint32_t, BinVariant, DefaultHasher<uint32_t>, SystemAllocPolicy>
+  js::HashMap<uint32_t, BinASTVariant, DefaultHasher<uint32_t>,
+              SystemAllocPolicy>
       variantsTable_;
 
   enum class MetadataOwnership { Owned, Unowned };
   MetadataOwnership metadataOwned_;
   BinASTSourceMetadata* metadata_;
 
   const uint8_t* posBeforeTree_;
 
@@ -274,25 +275,25 @@ class MOZ_STACK_CLASS BinASTTokenReaderM
     if (!std::equal(left.start_, left.start_ + left.byteLen_, right)) {
       return false;
     }
 
     return true;
   }
 
   template <size_t N>
-  static JS::Result<Ok, JS::Error&> checkFields(const BinKind kind,
-                                                const BinFields& actual,
-                                                const BinField (&expected)[N]) {
+  static JS::Result<Ok, JS::Error&> checkFields(
+      const BinASTKind kind, const BinASTFields& actual,
+      const BinASTField (&expected)[N]) {
     // Not implemented in this tokenizer.
     return Ok();
   }
 
-  static JS::Result<Ok, JS::Error&> checkFields0(const BinKind kind,
-                                                 const BinFields& actual) {
+  static JS::Result<Ok, JS::Error&> checkFields0(const BinASTKind kind,
+                                                 const BinASTFields& actual) {
     // Not implemented in this tokenizer.
     return Ok();
   }
 };
 
 }  // namespace frontend
 }  // namespace js
 
--- a/js/src/frontend/binast/src/main.rs
+++ b/js/src/frontend/binast/src/main.rs
@@ -157,23 +157,23 @@ struct GlobalRules {
     /// Header to add at the start of the .hpp file.
     /// defining the tokens.
     hpp_tokens_header: Option<String>,
 
     /// Footer to add at the start of the .hpp file.
     /// defining the tokens.
     hpp_tokens_footer: Option<String>,
 
-    /// Documentation for the `BinKind` class enum.
+    /// Documentation for the `BinASTKind` class enum.
     hpp_tokens_kind_doc: Option<String>,
 
-    /// Documentation for the `BinField` class enum.
+    /// Documentation for the `BinASTField` class enum.
     hpp_tokens_field_doc: Option<String>,
 
-    /// Documentation for the `BinVariant` class enum.
+    /// Documentation for the `BinASTVariant` class enum.
     hpp_tokens_variants_doc: Option<String>,
 
     /// Per-node rules.
     per_node: HashMap<NodeName, NodeRules>,
 }
 impl GlobalRules {
     fn new(syntax: &Spec, yaml: &yaml_rust::yaml::Yaml) -> Self {
         let rules = yaml.as_hash()
@@ -527,17 +527,17 @@ enum MethodCallKind {
     Var,
 
     /// Always use MOZ_TRY_VAR regardless of the result type.
     AlwaysVar,
 }
 
 /// Fixed parameter of interface method.
 const INTERFACE_PARAMS: &str =
-    "const size_t start, const BinKind kind, const BinFields& fields";
+    "const size_t start, const BinASTKind kind, const BinASTFields& fields";
 
 /// Fixed arguments of interface method.
 const INTERFACE_ARGS: &str =
     "start, kind, fields";
 
 /// The name of the toplevel interface for the script.
 const TOPLEVEL_INTERFACE: &str =
     "Program";
@@ -555,17 +555,17 @@ struct CPPExporter {
 
     /// All parsers of lists.
     list_parsers_to_generate: Vec<ListParserData>,
 
     /// All parsers of options.
     option_parsers_to_generate: Vec<OptionParserData>,
 
     /// A mapping from symbol (e.g. `+`, `-`, `instanceof`, ...) to the
-    /// name of the symbol as part of `enum class BinVariant`
+    /// name of the symbol as part of `enum class BinASTVariant`
     /// (e.g. `UnaryOperatorDelete`).
     variants_by_symbol: HashMap<String, String>,
 
     // A map from enum class names to the type.
     enum_types: HashMap<NodeName, Rc<String>>,
 }
 
 impl CPPExporter {
@@ -596,17 +596,17 @@ impl CPPExporter {
                     supports_empty: *supports_empty,
                     elements: content_node_name
                 });
             }
         }
         list_parsers_to_generate.sort_by(|a, b| str::cmp(a.name.to_str(), b.name.to_str()));
         option_parsers_to_generate.sort_by(|a, b| str::cmp(a.name.to_str(), b.name.to_str()));
 
-        // Prepare variant_by_symbol, which will let us lookup the BinVariant name of
+        // Prepare variant_by_symbol, which will let us lookup the BinASTVariant name of
         // a symbol. Since some symbols can appear in several enums (e.g. "+"
         // is both a unary and a binary operator), we need to collect all the
         // string enums that contain each symbol and come up with a unique name
         // (note that there is no guarantee of unicity – if collisions show up,
         // we may need to tweak the name generation algorithm).
         let mut enum_by_string : HashMap<String, Vec<NodeName>> = HashMap::new();
         let mut enum_types : HashMap<NodeName, Rc<String>> = HashMap::new();
         for (name, enum_) in syntax.string_enums_by_name().iter() {
@@ -939,47 +939,47 @@ impl CPPExporter {
         let kind_limit = node_names.len();
         buffer.push_str(&format!("\n#define FOR_EACH_BIN_KIND(F) \\\n{nodes}\n",
             nodes = node_names.iter()
                 .map(|name| format!("    F({enum_name}, \"{spec_name}\")",
                     enum_name = name.to_cpp_enum_case(),
                     spec_name = name))
                 .format(" \\\n")));
         buffer.push_str("
-enum class BinKind {
+enum class BinASTKind {
 #define EMIT_ENUM(name, _) name,
     FOR_EACH_BIN_KIND(EMIT_ENUM)
 #undef EMIT_ENUM
 };
 ");
 
-        buffer.push_str(&format!("\n// The number of distinct values of BinKind.\nconst size_t BINKIND_LIMIT = {};\n\n\n", kind_limit));
+        buffer.push_str(&format!("\n// The number of distinct values of BinASTKind.\nconst size_t BINASTKIND_LIMIT = {};\n\n\n", kind_limit));
         buffer.push_str("\n\n");
         if self.rules.hpp_tokens_field_doc.is_some() {
             buffer.push_str(&self.rules.hpp_tokens_field_doc.reindent(""));
         }
 
         let field_names = self.syntax.field_names()
             .keys()
             .sorted();
         let field_limit = field_names.len();
         buffer.push_str(&format!("\n#define FOR_EACH_BIN_FIELD(F) \\\n{nodes}\n",
             nodes = field_names.iter()
                 .map(|name| format!("    F({enum_name}, \"{spec_name}\")",
                     spec_name = name,
                     enum_name = name.to_cpp_enum_case()))
                 .format(" \\\n")));
         buffer.push_str("
-enum class BinField {
+enum class BinASTField {
 #define EMIT_ENUM(name, _) name,
     FOR_EACH_BIN_FIELD(EMIT_ENUM)
 #undef EMIT_ENUM
 };
 ");
-        buffer.push_str(&format!("\n// The number of distinct values of BinField.\nconst size_t BINFIELD_LIMIT = {};\n\n\n", field_limit));
+        buffer.push_str(&format!("\n// The number of distinct values of BinASTField.\nconst size_t BINASTFIELD_LIMIT = {};\n\n\n", field_limit));
 
         if self.rules.hpp_tokens_variants_doc.is_some() {
             buffer.push_str(&self.rules.hpp_tokens_variants_doc.reindent(""));
         }
         let enum_variants : Vec<_> = self.variants_by_symbol
             .iter()
             .sorted_by(|&(ref symbol_1, ref name_1), &(ref symbol_2, ref name_2)| {
                 Ord::cmp(name_1, name_2)
@@ -990,23 +990,23 @@ enum class BinField {
         buffer.push_str(&format!("\n#define FOR_EACH_BIN_VARIANT(F) \\\n{nodes}\n",
             nodes = enum_variants.into_iter()
                 .map(|(symbol, name)| format!("    F({variant_name}, \"{spec_name}\")",
                     spec_name = symbol,
                     variant_name = name))
                 .format(" \\\n")));
 
         buffer.push_str("
-enum class BinVariant {
+enum class BinASTVariant {
 #define EMIT_ENUM(name, _) name,
     FOR_EACH_BIN_VARIANT(EMIT_ENUM)
 #undef EMIT_ENUM
 };
 ");
-        buffer.push_str(&format!("\n// The number of distinct values of BinVariant.\nconst size_t BINVARIANT_LIMIT = {};\n\n\n",
+        buffer.push_str(&format!("\n// The number of distinct values of BinASTVariant.\nconst size_t BINASTVARIANT_LIMIT = {};\n\n\n",
             variants_limit));
 
         buffer.push_str(&self.rules.hpp_tokens_footer.reindent(""));
         buffer.push_str("\n");
     }
 
     /// Declare string enums
     fn export_declare_string_enums(&self, buffer: &mut String) {
@@ -1238,18 +1238,18 @@ impl CPPExporter {
                 nodes = nodes.iter()
                     .format("\n    "),
                 name = name.to_str());
 
             // Generate outer method
             buffer.push_str(&format!("{bnf}
 {first_line}
 {{
-    BinKind kind;
-    BinFields fields(cx_);
+    BinASTKind kind;
+    BinASTFields fields(cx_);
     AutoTaggedTuple guard(*tokenizer_);
     const auto start = tokenizer_->offset();
 
     MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
 {call}
 
     MOZ_TRY(guard.done());
@@ -1275,24 +1275,24 @@ impl CPPExporter {
         let mut buffer_cases = String::new();
         for node in nodes {
             let rule_for_this_arm = rules_for_this_sum.by_sum.get(&node)
                 .cloned()
                 .unwrap_or_default();
 
             if rule_for_this_arm.disabled {
                 buffer_cases.push_str(&format!("
-      case BinKind::{variant_name}:
+      case BinASTKind::{variant_name}:
         return raiseError(\"FIXME: Not implemented yet in this preview release ({variant_name})\");",
                     variant_name = node.to_cpp_enum_case()));
                 continue;
             }
 
             buffer_cases.push_str(&format!("
-      case BinKind::{variant_name}:
+      case BinASTKind::{variant_name}:
 {call}
 {arm_after}        break;",
                 call = self.get_method_call("result", node,
                                             "Interface", INTERFACE_ARGS,
                                             &extra_args,
                                             MethodCallKind::AlwaysVar)
                     .reindent("        "),
                 variant_name = node.to_cpp_enum_case(),
@@ -1453,25 +1453,25 @@ impl CPPExporter {
             } else {
                 panic!("Internal error: In {}, there should be a type with that name",
                     parser.name.to_str());
             };
         match named_implementation {
             NamedType::Interface(_) => {
                 buffer.push_str(&format!("{first_line}
 {{
-    BinKind kind;
-    BinFields fields(cx_);
+    BinASTKind kind;
+    BinASTFields fields(cx_);
     AutoTaggedTuple guard(*tokenizer_);
 
     MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
     {type_ok} result;
-    if (kind == BinKind::{null}) {{
+    if (kind == BinASTKind::{null}) {{
 {none_block}
-    }} else if (kind == BinKind::{kind}) {{
+    }} else if (kind == BinASTKind::{kind}) {{
         const auto start = tokenizer_->offset();
 {before}{call}{after}
     }} else {{
         return raiseInvalidKind(\"{kind}\", kind);
     }}
     MOZ_TRY(guard.done());
 
     return result;
@@ -1506,23 +1506,23 @@ impl CPPExporter {
                     kind = parser.elements.to_cpp_enum_case(),
                 ));
             }
             NamedType::Typedef(ref type_) => {
                 match type_.spec() {
                     &TypeSpec::TypeSum(_) => {
                 buffer.push_str(&format!("{first_line}
 {{
-    BinKind kind;
-    BinFields fields(cx_);
+    BinASTKind kind;
+    BinASTFields fields(cx_);
     AutoTaggedTuple guard(*tokenizer_);
 
     MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
     {type_ok} result;
-    if (kind == BinKind::{null}) {{
+    if (kind == BinASTKind::{null}) {{
 {none_block}
     }} else {{
         const auto start = tokenizer_->offset();
 {before}{call}{after}
     }}
     MOZ_TRY(guard.done());
 
     return result;
@@ -1668,22 +1668,22 @@ impl CPPExporter {
         if self.refgraph.is_used(name.to_rc_string().clone()) {
             // Generate comments
             let comment = format!("\n/*\n{}*/\n", ToWebidl::interface(interface, "", "    "));
             buffer.push_str(&comment);
 
             // Generate public method
             buffer.push_str(&format!("{first_line}
 {{
-    BinKind kind;
-    BinFields fields(cx_);
+    BinASTKind kind;
+    BinASTFields fields(cx_);
     AutoTaggedTuple guard(*tokenizer_);
 
     MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-    if (kind != BinKind::{kind}) {{
+    if (kind != BinASTKind::{kind}) {{
         return raiseInvalidKind(\"{kind}\", kind);
     }}
     const auto start = tokenizer_->offset();
 {call}
     MOZ_TRY(guard.done());
 
     return result;
 }}
@@ -1709,17 +1709,17 @@ impl CPPExporter {
         let number_of_fields = interface.contents().fields().len();
         let first_line = self.get_method_definition_start(name, inner_prefix,
                                                           INTERFACE_PARAMS,
                                                           &extra_params);
 
         let fields_type_list = format!("{{ {} }}", interface.contents()
             .fields()
             .iter()
-            .map(|field| format!("BinField::{}", field.name().to_cpp_enum_case()))
+            .map(|field| format!("BinASTField::{}", field.name().to_cpp_enum_case()))
             .format(", "));
 
         let mut fields_implem = String::new();
         for field in interface.contents().fields() {
             let rules_for_this_field = rules_for_this_interface.by_field.get(field.name())
                 .cloned()
                 .unwrap_or_default();
             let needs_block = rules_for_this_field.block_before_field.is_some() || rules_for_this_field.block_after_field.is_some();
@@ -1876,25 +1876,25 @@ impl CPPExporter {
             ));
         } else {
             let check_fields = if number_of_fields == 0 {
                 format!("MOZ_TRY(tokenizer_->checkFields0(kind, fields));")
             } else {
                 // The following strategy is designed for old versions of clang.
                 format!("
 #if defined(DEBUG)
-    const BinField expected_fields[{number_of_fields}] = {fields_type_list};
+    const BinASTField expected_fields[{number_of_fields}] = {fields_type_list};
     MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif // defined(DEBUG)",
                     fields_type_list = fields_type_list,
                     number_of_fields = number_of_fields)
             };
             buffer.push_str(&format!("{first_line}
 {{
-    MOZ_ASSERT(kind == BinKind::{kind});
+    MOZ_ASSERT(kind == BinASTKind::{kind});
     BINJS_TRY(CheckRecursionLimit(cx_));
 {check_fields}
 {pre}{fields_implem}
 {post}    return result;
 }}
 
 ",
                 check_fields = check_fields,
@@ -1955,21 +1955,21 @@ impl CPPExporter {
 {cases}
       default:
         return raiseInvalidVariant(\"{kind}\", variant);
     }}",
                     kind = kind,
                     cases = enum_.strings()
                         .iter()
                         .map(|symbol| {
-                            format!("    case BinVariant::{binvariant_variant}:
+                            format!("    case BinASTVariant::{binastvariant_variant}:
         return {kind}::{specialized_variant};",
                                 kind = kind,
                                 specialized_variant = symbol.to_cpp_enum_case(),
-                                binvariant_variant  = self.variants_by_symbol.get(symbol)
+                                binastvariant_variant  = self.variants_by_symbol.get(symbol)
                                     .unwrap()
                             )
                         })
                         .format("\n")
                 );
 
                 let rendered_doc = format!("/*\nenum {kind} {{\n{cases}\n}};\n*/\n",
                     kind = kind,
--- a/js/src/vm/JSScript.cpp
+++ b/js/src/vm/JSScript.cpp
@@ -2626,41 +2626,42 @@ XDRResult ScriptSource::XDR(XDRState<mod
     }
 
     uint8_t hasMetadata = !!ss->binASTMetadata_;
     MOZ_TRY(xdr->codeUint8(&hasMetadata));
     if (hasMetadata) {
 #if defined(JS_BUILD_BINAST)
       UniquePtr<frontend::BinASTSourceMetadata>& binASTMetadata =
           ss->binASTMetadata_;
-      uint32_t numBinKinds;
+      uint32_t numBinASTKinds;
       uint32_t numStrings;
       if (mode == XDR_ENCODE) {
-        numBinKinds = binASTMetadata->numBinKinds();
+        numBinASTKinds = binASTMetadata->numBinASTKinds();
         numStrings = binASTMetadata->numStrings();
       }
-      MOZ_TRY(xdr->codeUint32(&numBinKinds));
+      MOZ_TRY(xdr->codeUint32(&numBinASTKinds));
       MOZ_TRY(xdr->codeUint32(&numStrings));
 
       if (mode == XDR_DECODE) {
         // Use calloc, since we're storing this immediately, and filling it
         // might GC, to avoid marking bogus atoms.
         auto metadata = static_cast<frontend::BinASTSourceMetadata*>(
-            js_calloc(frontend::BinASTSourceMetadata::totalSize(numBinKinds,
+            js_calloc(frontend::BinASTSourceMetadata::totalSize(numBinASTKinds,
                                                                 numStrings)));
         if (!metadata) {
           return xdr->fail(JS::TranscodeResult_Throw);
         }
-        new (metadata) frontend::BinASTSourceMetadata(numBinKinds, numStrings);
+        new (metadata)
+            frontend::BinASTSourceMetadata(numBinASTKinds, numStrings);
         ss->setBinASTSourceMetadata(metadata);
       }
 
-      for (uint32_t i = 0; i < numBinKinds; i++) {
-        frontend::BinKind* binKindBase = binASTMetadata->binKindBase();
-        MOZ_TRY(xdr->codeEnum32(&binKindBase[i]));
+      for (uint32_t i = 0; i < numBinASTKinds; i++) {
+        frontend::BinASTKind* binASTKindBase = binASTMetadata->binASTKindBase();
+        MOZ_TRY(xdr->codeEnum32(&binASTKindBase[i]));
       }
 
       RootedAtom atom(xdr->cx());
       JSAtom** atomsBase = binASTMetadata->atomsBase();
       auto slices = binASTMetadata->sliceBase();
       auto sourceBase = reinterpret_cast<const char*>(ss->binASTSource());
 
       for (uint32_t i = 0; i < numStrings; i++) {