Bug 1396156 - Fix unused private field error when building AutoAssertNoGC as Beta. r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Mon, 04 Sep 2017 02:25:00 -0400
changeset 429577 84323938eaeb43ed6d4d4875157bbf5193f4d828
parent 429576 2eeabcda5e4c04e732071e1bd5475f6fb9a715c0
child 429578 336effc1fe448609533d7756e5ce95a8eb99c57f
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1396156
milestone57.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 1396156 - Fix unused private field error when building AutoAssertNoGC as Beta. r=sfink
js/public/GCAPI.h
--- a/js/public/GCAPI.h
+++ b/js/public/GCAPI.h
@@ -521,24 +521,25 @@ class JS_PUBLIC_API(AutoRequireNoGC)
  * class is live. This class does not disable the static rooting hazard
  * analysis.
  *
  * This works by entering a GC unsafe region, which is checked on allocation and
  * on GC.
  */
 class JS_PUBLIC_API(AutoAssertNoGC) : public AutoRequireNoGC
 {
+#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
     JSContext* cx_;
 
   public:
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
     // This gets the context from TLS if it is not passed in.
     explicit AutoAssertNoGC(JSContext* cx = nullptr);
     ~AutoAssertNoGC();
 #else
+  public:
     explicit AutoAssertNoGC(JSContext* cx = nullptr) {}
     ~AutoAssertNoGC() {}
 #endif
 };
 
 /**
  * Disable the static rooting hazard analysis in the live region and assert in
  * debug builds if any allocation that could potentially trigger a GC occurs