Backed out 5 changesets (bug 1635839) for failures on not-iterable.js. CLOSED TREE
authorCsoregi Natalia <ncsoregi@mozilla.com>
Tue, 02 Jun 2020 17:11:15 +0300
changeset 597585 023c0fdf6679bde4ba0772ff5c060c371e2f268e
parent 597584 71080a3ec16c2d304eddad7318c6748bd3724423
child 597586 d127e38737244996ef29e571a63402f435b12d18
push id13310
push userffxbld-merge
push dateMon, 29 Jun 2020 14:50:06 +0000
treeherdermozilla-beta@15a59a0afa5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1635839
milestone79.0a1
backs outa9ccc860736e5349b63eef46168bea6b9ff59018
593a8860ad5008ad4a209c8f04e3b0b111f0c51f
9cae1becce65fc531e063157a47fce86ff083e5b
0f28dc01529f24ab83f62c8f834e25f38cf87ab0
e90011b2f167c4ee09fbe6091febc5af9847c00b
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
Backed out 5 changesets (bug 1635839) for failures on not-iterable.js. CLOSED TREE Backed out changeset a9ccc860736e (bug 1635839) Backed out changeset 593a8860ad50 (bug 1635839) Backed out changeset 9cae1becce65 (bug 1635839) Backed out changeset 0f28dc01529f (bug 1635839) Backed out changeset e90011b2f167 (bug 1635839)
js/public/CompileOptions.h
js/public/RealmOptions.h
js/public/Symbol.h
js/src/builtin/TestingFunctions.cpp
js/src/frontend/Parser.cpp
js/src/frontend/TokenKind.h
js/src/frontend/TokenStream.cpp
js/src/gdb/mozilla/JSSymbol.py
js/src/js.msg
js/src/jsapi.cpp
js/src/shell/js.cpp
js/src/shell/jsshell.h
js/src/tests/non262/PrivateName/browser.js
js/src/tests/non262/PrivateName/illegal-in-class-context.js
js/src/tests/non262/PrivateName/illegal-in-identifier-context.js
js/src/tests/non262/PrivateName/not-iterable.js
js/src/tests/non262/PrivateName/shell.js
js/src/vm/Iteration.cpp
js/src/vm/SymbolType.cpp
js/src/vm/SymbolType.h
js/src/vm/ToSource.cpp
--- a/js/public/CompileOptions.h
+++ b/js/public/CompileOptions.h
@@ -125,17 +125,16 @@ class JS_PUBLIC_API TransitiveCompileOpt
   AsmJSOption asmJSOption = AsmJSOption::Disabled;
   bool throwOnAsmJSValidationFailureOption = false;
   bool forceAsync = false;
   bool discardSource = false;
   bool sourceIsLazy = false;
   bool allowHTMLComments = true;
   bool hideScriptFromDebugger = false;
   bool nonSyntacticScope = false;
-  bool privateClassFields = false;
 
   /**
    * |introductionType| is a statically allocated C string: one of "eval",
    * "Function", or "GeneratorFunction".
    */
   const char* introductionType = nullptr;
 
   unsigned introductionLineno = 0;
--- a/js/public/RealmOptions.h
+++ b/js/public/RealmOptions.h
@@ -229,22 +229,16 @@ class JS_PUBLIC_API RealmCreationOptions
   }
 
   bool getIteratorHelpersEnabled() const { return iteratorHelpers_; }
   RealmCreationOptions& setIteratorHelpersEnabled(bool flag) {
     iteratorHelpers_ = flag;
     return *this;
   }
 
-  bool getPrivateClassFieldsEnabled() const { return privateClassFields_; }
-  RealmCreationOptions& setPrivateClassFieldsEnabled(bool flag) {
-    privateClassFields_ = flag;
-    return *this;
-  }
-
   // This flag doesn't affect JS engine behavior.  It is used by Gecko to
   // mark whether content windows and workers are "Secure Context"s. See
   // https://w3c.github.io/webappsec-secure-contexts/
   // https://bugzilla.mozilla.org/show_bug.cgi?id=1162772#c34
   bool secureContext() const { return secureContext_; }
   RealmCreationOptions& setSecureContext(bool flag) {
     secureContext_ = flag;
     return *this;
@@ -275,17 +269,16 @@ class JS_PUBLIC_API RealmCreationOptions
   bool readableByteStreams_ = false;
   bool byobStreamReaders_ = false;
   bool writableStreams_ = false;
   bool readableStreamPipeTo_ = false;
   bool weakRefs_ = false;
   bool toSource_ = false;
   bool propertyErrorMessageFix_ = false;
   bool iteratorHelpers_ = false;
-  bool privateClassFields_ = false;
   bool secureContext_ = false;
 };
 
 /**
  * RealmBehaviors specifies behaviors of a realm that can be changed after the
  * realm's been created.
  */
 class JS_PUBLIC_API RealmBehaviors {
--- a/js/public/Symbol.h
+++ b/js/public/Symbol.h
@@ -70,17 +70,16 @@ enum class SymbolCode : uint32_t {
 #define JS_DEFINE_SYMBOL_ENUM(name) name,
   JS_FOR_EACH_WELL_KNOWN_SYMBOL(
       JS_DEFINE_SYMBOL_ENUM)  // SymbolCode::iterator, etc.
 #undef JS_DEFINE_SYMBOL_ENUM
   Limit,
   WellKnownAPILimit =
       0x80000000,  // matches JS::shadow::Symbol::WellKnownAPILimit for inline
                    // use
-  PrivateNameSymbol = 0xfffffffd,  // created by the #PrivateName syntax.
   InSymbolRegistry =
       0xfffffffe,            // created by Symbol.for() or JS::GetSymbolFor()
   UniqueSymbol = 0xffffffff  // created by Symbol() or JS::NewSymbol()
 };
 
 /* For use in loops that iterate over the well-known symbols. */
 const size_t WellKnownSymbolLimit = size_t(SymbolCode::Limit);
 
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -6166,36 +6166,16 @@ static bool BaselineCompile(JSContext* c
 
 static bool ClearKeptObjects(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   JS::ClearKeptObjects(cx);
   args.rval().setUndefined();
   return true;
 }
 
-static bool NewPrivateName(JSContext* cx, unsigned argc, Value* vp) {
-  CallArgs args = CallArgsFromVp(argc, vp);
-  if (!args.requireAtLeast(cx, "newPrivateName", 1)) {
-    return false;
-  }
-
-  RootedString desc(cx, ToString(cx, args[0]));
-  if (!desc) {
-    return false;
-  }
-
-  auto* sym = JS::Symbol::new_(cx, JS::SymbolCode::PrivateNameSymbol, desc);
-  if (!sym) {
-    return false;
-  }
-
-  args.rval().setSymbol(sym);
-  return true;
-}
-
 static bool PCCountProfiling_Start(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
 
   js::StartPCCountProfiling(cx);
 
   args.rval().setUndefined();
   return true;
 }
@@ -7125,20 +7105,16 @@ gc::ZealModeHelpText),
 
    JS_FN_HELP("clearKeptObjects", ClearKeptObjects, 0, 0,
 "clearKeptObjects()",
 "Perform the ECMAScript ClearKeptObjects operation, clearing the list of\n"
 "observed WeakRef targets that are kept alive until the next synchronous\n"
 "sequence of ECMAScript execution completes. This is used for testing\n"
 "WeakRefs.\n"),
 
-  JS_FN_HELP("newPrivateName", NewPrivateName, 1, 0,
-"newPrivateName(desc)",
-"Create a new PrivateName symbol."),
-
     JS_FS_HELP_END
 };
 // clang-format on
 
 // clang-format off
 static const JSFunctionSpecWithHelp FuzzingUnsafeTestingFunctions[] = {
 #if defined(DEBUG) && !defined(ENABLE_NEW_REGEXP)
     JS_FN_HELP("parseRegExp", ParseRegExp, 3, 0,
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -9707,17 +9707,17 @@ bool GeneralParser<ParseHandler, Unit>::
     tt = hint;
   }
 
   if (!pc_->sc()->allowArguments() && ident == cx_->names().arguments) {
     error(JSMSG_BAD_ARGUMENTS);
     return false;
   }
 
-  if (tt == TokenKind::Name) {
+  if (tt == TokenKind::Name || tt == TokenKind::PrivateName) {
     return true;
   }
   if (TokenKindIsContextualKeyword(tt)) {
     if (tt == TokenKind::Yield) {
       if (yieldHandling == YieldIsKeyword) {
         errorAt(offset, JSMSG_RESERVED_ID, "yield");
         return false;
       }
--- a/js/src/frontend/TokenKind.h
+++ b/js/src/frontend/TokenKind.h
@@ -306,18 +306,18 @@ inline MOZ_MUST_USE bool TokenKindIsRese
 }
 
 inline MOZ_MUST_USE bool TokenKindIsReservedWord(TokenKind tt) {
   return TokenKindIsKeyword(tt) || TokenKindIsFutureReservedWord(tt) ||
          TokenKindIsReservedWordLiteral(tt);
 }
 
 inline MOZ_MUST_USE bool TokenKindIsPossibleIdentifier(TokenKind tt) {
-  return tt == TokenKind::Name || TokenKindIsContextualKeyword(tt) ||
-         TokenKindIsStrictReservedWord(tt);
+  return tt == TokenKind::Name || tt == TokenKind::PrivateName ||
+         TokenKindIsContextualKeyword(tt) || TokenKindIsStrictReservedWord(tt);
 }
 
 inline MOZ_MUST_USE bool TokenKindIsPossibleIdentifierName(TokenKind tt) {
   return TokenKindIsPossibleIdentifier(tt) || TokenKindIsReservedWord(tt);
 }
 
 }  // namespace frontend
 }  // namespace js
--- a/js/src/frontend/TokenStream.cpp
+++ b/js/src/frontend/TokenStream.cpp
@@ -59,16 +59,20 @@ using mozilla::MakeSpan;
 using mozilla::Maybe;
 using mozilla::PointerRangeSize;
 using mozilla::Utf8Unit;
 
 using JS::ReadOnlyCompileOptions;
 using JS::RegExpFlag;
 using JS::RegExpFlags;
 
+// There's some very preliminary support for private fields in this file. It's
+// disabled in all builds, for now.
+//#define JS_PRIVATE_FIELDS 1
+
 struct ReservedWordInfo {
   const char* chars;  // C string with reserved word text
   js::frontend::TokenKind tokentype;
 };
 
 static const ReservedWordInfo reservedWords[] = {
 #define RESERVED_WORD_INFO(word, name, type) \
   {js_##word##_str, js::frontend::type},
@@ -126,30 +130,38 @@ MOZ_ALWAYS_INLINE const ReservedWordInfo
 }
 
 static const ReservedWordInfo* FindReservedWord(
     JSLinearString* str, js::frontend::NameVisibility* visibility) {
   JS::AutoCheckCannotGC nogc;
   if (str->hasLatin1Chars()) {
     const JS::Latin1Char* chars = str->latin1Chars(nogc);
     size_t length = str->length();
+#ifdef JS_PRIVATE_FIELDS
     if (length > 0 && chars[0] == '#') {
       *visibility = js::frontend::NameVisibility::Private;
       return nullptr;
     }
+#else
+    MOZ_ASSERT_IF(length > 0, chars[0] != '#');
+#endif
     *visibility = js::frontend::NameVisibility::Public;
     return FindReservedWord(chars, length);
   }
 
   const char16_t* chars = str->twoByteChars(nogc);
   size_t length = str->length();
+#ifdef JS_PRIVATE_FIELDS
   if (length > 0 && chars[0] == '#') {
     *visibility = js::frontend::NameVisibility::Private;
     return nullptr;
   }
+#else
+  MOZ_ASSERT_IF(length > 0, chars[0] != '#');
+#endif
   *visibility = js::frontend::NameVisibility::Public;
   return FindReservedWord(chars, length);
 }
 
 static uint32_t GetSingleCodePoint(const char16_t** p, const char16_t* end) {
   using namespace js;
 
   uint32_t codePoint;
@@ -229,20 +241,23 @@ bool IsIdentifier(const Latin1Char* char
   return true;
 }
 
 bool IsIdentifierNameOrPrivateName(const Latin1Char* chars, size_t length) {
   if (length == 0) {
     return false;
   }
 
-  // Skip over any private name marker.
-  if (*chars == '#') {
+  if (char16_t(*chars) == '#') {
+#ifdef JS_PRIVATE_FIELDS
     ++chars;
     --length;
+#else
+    return false;
+#endif
   }
 
   return IsIdentifier(chars, length);
 }
 
 bool IsIdentifier(const char16_t* chars, size_t length) {
   if (length == 0) {
     return false;
@@ -272,25 +287,26 @@ bool IsIdentifierNameOrPrivateName(const
     return false;
   }
 
   const char16_t* p = chars;
   const char16_t* end = chars + length;
   uint32_t codePoint;
 
   codePoint = GetSingleCodePoint(&p, end);
-
-  // Skip over any private name marker.
   if (codePoint == '#') {
-    // The identifier part of a private name mustn't be empty.
+#ifdef JS_PRIVATE_FIELDS
     if (length == 1) {
       return false;
     }
 
     codePoint = GetSingleCodePoint(&p, end);
+#else
+    return false;
+#endif
   }
 
   if (!unicode::IsIdentifierStart(codePoint)) {
     return false;
   }
 
   while (p < end) {
     codePoint = GetSingleCodePoint(&p, end);
@@ -2136,17 +2152,21 @@ bool TokenStreamSpecific<Unit, AnyCharsA
   do {
     int32_t unit = getCodeUnit();
     if (unit == EOF) {
       break;
     }
 
     uint32_t codePoint;
     if (MOZ_LIKELY(isAsciiCodePoint(unit))) {
-      if (unicode::IsIdentifierPart(char16_t(unit)) || unit == '#') {
+      if (unicode::IsIdentifierPart(char16_t(unit))
+#ifdef JS_PRIVATE_FIELDS
+          || char16_t(unit) == '#'
+#endif
+      ) {
         if (!this->charBuffer.append(unit)) {
           return false;
         }
 
         continue;
       }
 
       if (unit != '\\' || !matchUnicodeEscapeIdent(&codePoint)) {
@@ -2250,18 +2270,18 @@ MOZ_MUST_USE bool TokenStreamSpecific<Un
     atom = atomizeSourceChars(anyCharsAccess().cx, MakeSpan(chars, length));
   }
   if (!atom) {
     return false;
   }
 
   noteBadToken.release();
   if (visibility == NameVisibility::Private) {
-    newPrivateNameToken(atom->asPropertyName(), start, modifier, out);
-    return true;
+    errorAt(start.offset(), JSMSG_PRIVATE_FIELDS_NOT_SUPPORTED);
+    return false;
   }
   newNameToken(atom->asPropertyName(), start, modifier, out);
   return true;
 }
 
 enum FirstCharKind {
   // A char16_t has the 'OneChar' kind if it, by itself, constitutes a valid
   // token that cannot also be a prefix of a longer token.  E.g. ';' has the
@@ -3043,30 +3063,30 @@ MOZ_MUST_USE bool TokenStreamSpecific<Un
         // NOTE: |unit| may be EOF here.  A stray '.' at EOF would be an
         //       error, but subsequent code will handle it.
         ungetCodeUnit(unit);
 
         simpleKind = TokenKind::Dot;
         break;
 
       case '#': {
-        if (options().privateClassFields) {
-          TokenStart start(this->sourceUnits, -1);
-          const Unit* identStart =
-              this->sourceUnits.addressOfNextCodeUnit() - 1;
-          IdentifierEscapes sawEscape;
-          if (!matchIdentifierStart(&sawEscape)) {
-            return badToken();
-          }
-          return identifierName(start, identStart, sawEscape, modifier,
-                                NameVisibility::Private, ttp);
+#ifdef JS_PRIVATE_FIELDS
+        TokenStart start(this->sourceUnits, -1);
+        const Unit* identStart = this->sourceUnits.addressOfNextCodeUnit() - 1;
+        IdentifierEscapes sawEscape;
+        if (!matchIdentifierStart(&sawEscape)) {
+          return badToken();
         }
+        return identifierName(start, identStart, sawEscape, modifier,
+                              NameVisibility::Private, ttp);
+#else
         ungetCodeUnit(unit);
         error(JSMSG_PRIVATE_FIELDS_NOT_SUPPORTED);
         return badToken();
+#endif
       }
 
       case '=':
         if (matchCodeUnit('=')) {
           simpleKind = matchCodeUnit('=') ? TokenKind::StrictEq : TokenKind::Eq;
         } else if (matchCodeUnit('>')) {
           simpleKind = TokenKind::Arrow;
         } else {
--- a/js/src/gdb/mozilla/JSSymbol.py
+++ b/js/src/gdb/mozilla/JSSymbol.py
@@ -7,17 +7,16 @@
 import mozilla.prettyprinters
 from mozilla.prettyprinters import ptr_pretty_printer
 from mozilla.CellHeader import get_header_ptr
 
 # Forget any printers from previous loads of this module.
 mozilla.prettyprinters.clear_module_printers(__name__)
 
 # JS::SymbolCode enumerators
-PrivateNameSymbol = 0xfffffffd
 InSymbolRegistry = 0xfffffffe
 UniqueSymbol = 0xffffffff
 
 
 @ptr_pretty_printer("JS::Symbol")
 class JSSymbolPtr(mozilla.prettyprinters.Pointer):
     def __init__(self, value, cache):
         super(JSSymbolPtr, self).__init__(value, cache)
@@ -26,16 +25,14 @@ class JSSymbolPtr(mozilla.prettyprinters
     def to_string(self):
         code = int(self.value['code_']) & 0xffffffff
         desc = str(get_header_ptr(self.value['headerAndDescription_'],
                                   self.cache.JSString_ptr_t))
         if code == InSymbolRegistry:
             return "Symbol.for({})".format(desc)
         elif code == UniqueSymbol:
             return "Symbol({})".format(desc)
-        elif code == PrivateNameSymbol:
-            return "#{}".format(desc)
         else:
             # Well-known symbol. Strip off the quotes added by the JSString *
             # pretty-printer.
             assert desc[0] == '"'
             assert desc[-1] == '"'
             return desc[1:-1]
--- a/js/src/js.msg
+++ b/js/src/js.msg
@@ -358,17 +358,16 @@ MSG_DEF(JSMSG_YIELD_OUTSIDE_GENERATOR, 0
 MSG_DEF(JSMSG_BAD_COLUMN_NUMBER,       0, JSEXN_RANGEERR, "column number out of range")
 MSG_DEF(JSMSG_COMPUTED_NAME_IN_PATTERN,0, JSEXN_SYNTAXERR, "computed property names aren't supported in this destructuring declaration")
 MSG_DEF(JSMSG_DEFAULT_IN_PATTERN,      0, JSEXN_SYNTAXERR, "destructuring defaults aren't supported in this destructuring declaration")
 MSG_DEF(JSMSG_BAD_NEWTARGET,           0, JSEXN_SYNTAXERR, "new.target only allowed within functions")
 MSG_DEF(JSMSG_BAD_NEW_OPTIONAL,        0, JSEXN_SYNTAXERR, "new keyword cannot be used with an optional chain")
 MSG_DEF(JSMSG_BAD_OPTIONAL_TEMPLATE,   0, JSEXN_SYNTAXERR, "tagged template cannot be used with optional chain")
 MSG_DEF(JSMSG_ESCAPED_KEYWORD,         0, JSEXN_SYNTAXERR, "keywords must be written literally, without embedded escapes")
 MSG_DEF(JSMSG_PRIVATE_FIELDS_NOT_SUPPORTED, 0, JSEXN_SYNTAXERR, "private fields are not currently supported")
-MSG_DEF(JSMSG_ILLEGAL_PRIVATE_FIELD,   0, JSEXN_SYNTAXERR, "private fields aren't valid in this context")
 
 // UTF-8 source text encoding errors
 MSG_DEF(JSMSG_BAD_LEADING_UTF8_UNIT,   1, JSEXN_SYNTAXERR, "{0} byte doesn't begin a valid UTF-8 code point")
 MSG_DEF(JSMSG_NOT_ENOUGH_CODE_UNITS,   5, JSEXN_SYNTAXERR, "{0} byte in UTF-8 must be followed by {1} byte{2}, but {3} byte{4} present")
 MSG_DEF(JSMSG_BAD_TRAILING_UTF8_UNIT,  1, JSEXN_SYNTAXERR, "bad trailing UTF-8 byte {0} doesn't match the pattern 0b10xxxxxx")
 MSG_DEF(JSMSG_FORBIDDEN_UTF8_CODE_POINT,2,JSEXN_SYNTAXERR, "{0} isn't a valid code point because {1}")
 MSG_DEF(JSMSG_BAD_CODE_UNITS,          1, JSEXN_NOTE, "the code units comprising this invalid code point were: {0}")
 
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -3468,17 +3468,16 @@ void JS::TransitiveCompileOptions::copyP
   discardSource = rhs.discardSource;
   sourceIsLazy = rhs.sourceIsLazy;
   introductionType = rhs.introductionType;
   introductionLineno = rhs.introductionLineno;
   introductionOffset = rhs.introductionOffset;
   hasIntroductionInfo = rhs.hasIntroductionInfo;
   hideScriptFromDebugger = rhs.hideScriptFromDebugger;
   nonSyntacticScope = rhs.nonSyntacticScope;
-  privateClassFields = rhs.privateClassFields;
 };
 
 void JS::ReadOnlyCompileOptions::copyPODNonTransitiveOptions(
     const ReadOnlyCompileOptions& rhs) {
   lineno = rhs.lineno;
   column = rhs.column;
   scriptSourceOffset = rhs.scriptSourceOffset;
   isRunOnce = rhs.isRunOnce;
@@ -3560,18 +3559,16 @@ JS::CompileOptions::CompileOptions(JSCon
     asmJSOption = AsmJSOption::Disabled;
   } else if (cx->realm()->debuggerObservesAsmJS()) {
     asmJSOption = AsmJSOption::DisabledByDebugger;
   } else {
     asmJSOption = AsmJSOption::Enabled;
   }
   throwOnAsmJSValidationFailureOption =
       cx->options().throwOnAsmJSValidationFailure();
-  privateClassFields =
-      cx->realm()->creationOptions().getPrivateClassFieldsEnabled();
 
   sourcePragmas_ = cx->options().sourcePragmas();
 
   // Certain modes of operation force strict-mode in general.
   forceStrictMode_ = cx->options().strictMode();
 
   // Certain modes of operation disallow syntax parsing in general.
   forceFullParse_ = cx->realm()->behaviors().disableLazyParsing() ||
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -508,17 +508,16 @@ bool shell::enableStreams = false;
 bool shell::enableReadableByteStreams = false;
 bool shell::enableBYOBStreamReaders = false;
 bool shell::enableWritableStreams = false;
 bool shell::enableReadableStreamPipeTo = false;
 bool shell::enableWeakRefs = false;
 bool shell::enableToSource = false;
 bool shell::enablePropertyErrorMessageFix = false;
 bool shell::enableIteratorHelpers = false;
-bool shell::enablePrivateClassFields = false;
 #ifdef JS_GC_ZEAL
 uint32_t shell::gZealBits = 0;
 uint32_t shell::gZealFrequency = 0;
 #endif
 bool shell::printTiming = false;
 RCFile* shell::gErrFile = nullptr;
 RCFile* shell::gOutFile = nullptr;
 bool shell::reportWarnings = true;
@@ -3889,18 +3888,17 @@ static void SetStandardRealmOptions(JS::
       .setStreamsEnabled(enableStreams)
       .setReadableByteStreamsEnabled(enableReadableByteStreams)
       .setBYOBStreamReadersEnabled(enableBYOBStreamReaders)
       .setWritableStreamsEnabled(enableWritableStreams)
       .setReadableStreamPipeToEnabled(enableReadableStreamPipeTo)
       .setWeakRefsEnabled(enableWeakRefs)
       .setToSourceEnabled(enableToSource)
       .setPropertyErrorMessageFixEnabled(enablePropertyErrorMessageFix)
-      .setIteratorHelpersEnabled(enableIteratorHelpers)
-      .setPrivateClassFieldsEnabled(enablePrivateClassFields);
+      .setIteratorHelpersEnabled(enableIteratorHelpers);
 }
 
 static MOZ_MUST_USE bool CheckRealmOptions(JSContext* cx,
                                            JS::RealmOptions& options,
                                            JSPrincipals* principals) {
   JS::RealmCreationOptions& creationOptions = options.creationOptions();
   if (creationOptions.compartmentSpecifier() !=
       JS::CompartmentSpecifier::ExistingCompartment) {
@@ -10258,17 +10256,16 @@ static bool SetContextOptions(JSContext*
   enableBYOBStreamReaders = op.getBoolOption("enable-byob-stream-readers");
   enableWritableStreams = op.getBoolOption("enable-writable-streams");
   enableReadableStreamPipeTo = op.getBoolOption("enable-readablestream-pipeto");
   enableWeakRefs = op.getBoolOption("enable-weak-refs");
   enableToSource = !op.getBoolOption("disable-tosource");
   enablePropertyErrorMessageFix =
       !op.getBoolOption("disable-property-error-message-fix");
   enableIteratorHelpers = op.getBoolOption("enable-iterator-helpers");
-  enablePrivateClassFields = op.getBoolOption("enable-private-fields");
 
   JS::ContextOptionsRef(cx)
       .setAsmJS(enableAsmJS)
       .setWasm(enableWasm)
       .setWasmForTrustedPrinciples(enableWasm)
       .setWasmBaseline(enableWasmBaseline)
       .setWasmIon(enableWasmIon)
       .setWasmReftypes(enableWasmReftypes)
@@ -11132,18 +11129,16 @@ int main(int argc, char** argv, char** e
                         "WHATWG ReadableStream.prototype.pipeTo") ||
       !op.addBoolOption('\0', "enable-weak-refs", "Enable weak references") ||
       !op.addBoolOption('\0', "disable-tosource", "Disable toSource/uneval") ||
       !op.addBoolOption('\0', "disable-property-error-message-fix",
                         "Disable fix for the error message when accessing "
                         "property of null or undefined") ||
       !op.addBoolOption('\0', "enable-iterator-helpers",
                         "Enable iterator helpers") ||
-      !op.addBoolOption('\0', "enable-private-fields",
-                        "Enable private class fields") ||
       !op.addStringOption('\0', "shared-memory", "on/off",
                           "SharedArrayBuffer and Atomics "
 #if SHARED_MEMORY_DEFAULT
                           "(default: on, off to disable)"
 #else
                           "(default: off, on to enable)"
 #endif
                           ) ||
--- a/js/src/shell/jsshell.h
+++ b/js/src/shell/jsshell.h
@@ -134,17 +134,16 @@ extern bool enableStreams;
 extern bool enableReadableByteStreams;
 extern bool enableBYOBStreamReaders;
 extern bool enableWritableStreams;
 extern bool enableReadableStreamPipeTo;
 extern bool enableWeakRefs;
 extern bool enableToSource;
 extern bool enablePropertyErrorMessageFix;
 extern bool enableIteratorHelpers;
-extern bool enablePrivateClassFields;
 #ifdef JS_GC_ZEAL
 extern uint32_t gZealBits;
 extern uint32_t gZealFrequency;
 #endif
 extern bool printTiming;
 extern RCFile* gErrFile;
 extern RCFile* gOutFile;
 extern bool reportWarnings;
deleted file mode 100644
--- a/js/src/tests/non262/PrivateName/browser.js
+++ /dev/null
@@ -1,3 +0,0 @@
-if (typeof newPrivateName === "undefined") {
-  var newPrivateName = SpecialPowers.Cu.getJSTestingFunctions().newPrivateName;
-}
deleted file mode 100644
--- a/js/src/tests/non262/PrivateName/illegal-in-class-context.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// |reftest| skip-if(!xulRuntime.shell)
-
-// Private names can't appear in classes (yet)
-
-assertThrowsInstanceOf(() => eval(`class A { #x }`), SyntaxError);
-assertThrowsInstanceOf(() => eval(`class A { #x=10 }`), SyntaxError);
-
-if (typeof reportCompare === 'function') reportCompare(0, 0);
deleted file mode 100644
--- a/js/src/tests/non262/PrivateName/illegal-in-identifier-context.js
+++ /dev/null
@@ -1,45 +0,0 @@
-// |reftest| skip-if(!xulRuntime.shell)
-
-// Private names can't appear in contexts where plain identifiers are expected.
-
-// Private names as binding identifiers.
-assertThrowsInstanceOf(() => eval(`var #a;`), SyntaxError);
-assertThrowsInstanceOf(() => eval(`let #a;`), SyntaxError);
-assertThrowsInstanceOf(() => eval(`const #a = 0;`), SyntaxError);
-assertThrowsInstanceOf(() => eval(`function #a(){}`), SyntaxError);
-assertThrowsInstanceOf(() => eval(`function f(#a){}`), SyntaxError);
-
-// With escape sequences (leading and non-leading case).
-assertThrowsInstanceOf(() => eval(String.raw`var #\u0061;`), SyntaxError);
-assertThrowsInstanceOf(() => eval(String.raw`var #a\u0061;`), SyntaxError);
-assertThrowsInstanceOf(() => eval(String.raw`let #\u0061;`), SyntaxError);
-assertThrowsInstanceOf(() => eval(String.raw`let #a\u0061;`), SyntaxError);
-assertThrowsInstanceOf(() => eval(String.raw`const #\u0061 = 0;`), SyntaxError);
-assertThrowsInstanceOf(() => eval(String.raw`const #a\u0061 = 0;`), SyntaxError);
-assertThrowsInstanceOf(() => eval(String.raw`function #\u0061(){}`), SyntaxError);
-assertThrowsInstanceOf(() => eval(String.raw`function #a\u0061(){}`), SyntaxError);
-assertThrowsInstanceOf(() => eval(String.raw`function f(#\u0061){}`), SyntaxError);
-assertThrowsInstanceOf(() => eval(String.raw`function f(#a\u0061){}`), SyntaxError);
-
-
-// Private names as label identifiers.
-assertThrowsInstanceOf(() => eval(`#a: ;`), SyntaxError);
-
-// With escape sequences (leading and non-leading case).
-assertThrowsInstanceOf(() => eval(String.raw`#\u0061: ;`), SyntaxError);
-assertThrowsInstanceOf(() => eval(String.raw`#a\u0061: ;`), SyntaxError);
-
-
-// Private names as identifier references.
-assertThrowsInstanceOf(() => eval(`#a = 0;`), SyntaxError);
-assertThrowsInstanceOf(() => eval(`typeof #a;`), SyntaxError);
-
-// With escape sequences (leading and non-leading case).
-assertThrowsInstanceOf(() => eval(String.raw`#\u0061 = 0;`), SyntaxError);
-assertThrowsInstanceOf(() => eval(String.raw`#a\u0061 = 0;`), SyntaxError);
-assertThrowsInstanceOf(() => eval(String.raw`typeof #\u0061;`), SyntaxError);
-assertThrowsInstanceOf(() => eval(String.raw`typeof #a\u0061;`), SyntaxError);
-
-
-if (typeof reportCompare === "function")
-  reportCompare(0, 0);
deleted file mode 100644
--- a/js/src/tests/non262/PrivateName/not-iterable.js
+++ /dev/null
@@ -1,35 +0,0 @@
-// PrivateNames aren't iterable.
-
-var name = newPrivateName('');
-
-var o = {
-  [name]: 123,
-};
-
-assertEq(o[name], 123);
-
-assertEq(Object.keys(o).length, 0);
-assertEq(Object.getOwnPropertyNames(o).length, 0);
-assertEq(Object.getOwnPropertySymbols(o).length, 0);
-assertEq(Reflect.ownKeys(o).length, 0);
-
-var forIn = [];
-for (var pk in o) {
-  forIn.push(pk);
-}
-assertEq(forIn.length, 0);
-
-// Proxy case
-var proxy = new Proxy(o, {});
-assertEq(Object.keys(proxy).length, 0);
-assertEq(Object.getOwnPropertyNames(proxy).length, 0);
-assertEq(Object.getOwnPropertySymbols(proxy).length, 0);
-assertEq(Reflect.ownKeys(proxy).length, 0);
-
-for (var pk in proxy) {
-  forIn.push(pk);
-}
-assertEq(forIn.length, 0);
-
-if (typeof reportCompare === 'function')
-  reportCompare(0, 0);
deleted file mode 100644
--- a/js/src/vm/Iteration.cpp
+++ b/js/src/vm/Iteration.cpp
@@ -120,26 +120,20 @@ static inline bool Enumerate(JSContext* 
   }
 
   if (!enumerable && !(flags & JSITER_HIDDEN)) {
     return true;
   }
 
   // Symbol-keyed properties and nonenumerable properties are skipped unless
   // the caller specifically asks for them. A caller can also filter out
-  // non-symbols by asking for JSITER_SYMBOLSONLY. PrivateName symbols are
-  // always skipped.
-  if (JSID_IS_SYMBOL(id)) {
-    if (!(flags & JSITER_SYMBOLS) || JSID_TO_SYMBOL(id)->isPrivateName()) {
-      return true;
-    }
-  } else {
-    if ((flags & JSITER_SYMBOLSONLY)) {
-      return true;
-    }
+  // non-symbols by asking for JSITER_SYMBOLSONLY.
+  if (JSID_IS_SYMBOL(id) ? !(flags & JSITER_SYMBOLS)
+                         : (flags & JSITER_SYMBOLSONLY)) {
+    return true;
   }
 
   return props.append(id);
 }
 
 static bool EnumerateExtraProperties(JSContext* cx, HandleObject obj,
                                      unsigned flags,
                                      MutableHandle<IdSet> visited,
@@ -396,18 +390,16 @@ struct SortComparatorIds {
     if (JSID_IS_INT(a)) {
       *lessOrEqualp = (JSID_TO_INT(a) <= JSID_TO_INT(b));
       return true;
     }
 
     RootedString astr(cx), bstr(cx);
     if (JSID_IS_SYMBOL(a)) {
       MOZ_ASSERT(JSID_IS_SYMBOL(b));
-      MOZ_ASSERT(!JSID_TO_SYMBOL(a)->isPrivateName());
-      MOZ_ASSERT(!JSID_TO_SYMBOL(b)->isPrivateName());
       JS::SymbolCode ca = JSID_TO_SYMBOL(a)->code();
       JS::SymbolCode cb = JSID_TO_SYMBOL(b)->code();
       if (ca != cb) {
         *lessOrEqualp = uint32_t(ca) <= uint32_t(cb);
         return true;
       }
       MOZ_ASSERT(ca == JS::SymbolCode::InSymbolRegistry ||
                  ca == JS::SymbolCode::UniqueSymbol);
--- a/js/src/vm/SymbolType.cpp
+++ b/js/src/vm/SymbolType.cpp
@@ -98,21 +98,16 @@ void Symbol::dump(js::GenericPrinter& ou
       out.printf("undefined");
     }
 
     out.putChar(')');
 
     if (code_ == SymbolCode::UniqueSymbol) {
       out.printf("@%p", (void*)this);
     }
-  } else if (code_ == SymbolCode::PrivateNameSymbol) {
-    MOZ_ASSERT(description());
-    out.putChar('#');
-    description()->dumpCharsNoNewline(out);
-    out.printf("@%p", (void*)this);
   } else {
     out.printf("<Invalid Symbol code=%u>", unsigned(code_));
   }
 }
 #endif  // defined(DEBUG) || defined(JS_JITSPEW)
 
 bool js::SymbolDescriptiveString(JSContext* cx, Symbol* sym,
                                  MutableHandleValue result) {
--- a/js/src/vm/SymbolType.h
+++ b/js/src/vm/SymbolType.h
@@ -79,19 +79,16 @@ class Symbol : public js::gc::TenuredCel
   // that's often looked up on random objects but is usually not present. We
   // optimize this by setting a flag on the object's BaseShape when such
   // symbol properties are added, so we can optimize lookups on objects that
   // don't have the BaseShape flag.
   bool isInterestingSymbol() const {
     return code_ == SymbolCode::toStringTag || code_ == SymbolCode::toPrimitive;
   }
 
-  // Symbol created for the #PrivateName syntax.
-  bool isPrivateName() const { return code_ == SymbolCode::PrivateNameSymbol; }
-
   static const JS::TraceKind TraceKind = JS::TraceKind::Symbol;
   const js::gc::CellHeader& cellHeader() const { return headerAndDescription_; }
 
   inline void traceChildren(JSTracer* trc) {
     js::TraceNullableEdge(trc, &headerAndDescription_, "symbol description");
   }
   inline void finalize(JSFreeOp*) {}
 
--- a/js/src/vm/ToSource.cpp
+++ b/js/src/vm/ToSource.cpp
@@ -54,44 +54,36 @@ static JSString* StringToSource(JSContex
     return nullptr;
   }
   return NewStringCopyZ<CanGC>(cx, chars.get());
 }
 
 static JSString* SymbolToSource(JSContext* cx, Symbol* symbol) {
   RootedString desc(cx, symbol->description());
   SymbolCode code = symbol->code();
-  if (symbol->isWellKnownSymbol()) {
+  if (code != SymbolCode::InSymbolRegistry &&
+      code != SymbolCode::UniqueSymbol) {
     // Well-known symbol.
+    MOZ_ASSERT(uint32_t(code) < JS::WellKnownSymbolLimit);
     return desc;
   }
 
   JSStringBuilder buf(cx);
-  if (code == SymbolCode::PrivateNameSymbol) {
-    MOZ_ASSERT(desc);
-    if (!buf.append('#') || !buf.append(desc)) {
+  if (code == SymbolCode::InSymbolRegistry ? !buf.append("Symbol.for(")
+                                           : !buf.append("Symbol(")) {
+    return nullptr;
+  }
+  if (desc) {
+    UniqueChars quoted = QuoteString(cx, desc, '"');
+    if (!quoted || !buf.append(quoted.get(), strlen(quoted.get()))) {
       return nullptr;
     }
-  } else {
-    MOZ_ASSERT(code == SymbolCode::InSymbolRegistry ||
-               code == SymbolCode::UniqueSymbol);
-
-    if (code == SymbolCode::InSymbolRegistry ? !buf.append("Symbol.for(")
-                                             : !buf.append("Symbol(")) {
-      return nullptr;
-    }
-    if (desc) {
-      UniqueChars quoted = QuoteString(cx, desc, '"');
-      if (!quoted || !buf.append(quoted.get(), strlen(quoted.get()))) {
-        return nullptr;
-      }
-    }
-    if (!buf.append(')')) {
-      return nullptr;
-    }
+  }
+  if (!buf.append(')')) {
+    return nullptr;
   }
   return buf.finishString();
 }
 
 static JSString* BoxedToSource(JSContext* cx, HandleObject obj,
                                const char* constructor) {
   RootedValue value(cx);
   if (!Unbox(cx, obj, &value)) {