--- a/js/public/AllocPolicy.h
+++ b/js/public/AllocPolicy.h
@@ -107,7 +107,7 @@
    * Non-inline helper to call JSRuntime::onOutOfMemory with minimal
    * code bloat.
    */
-  JS_FRIEND_API void* onOutOfMemory(arena_id_t arenaId, AllocFunction allocFunc,
+  void* onOutOfMemory(arena_id_t arenaId, AllocFunction allocFunc,
                                     size_t nbytes, void* reallocPtr = nullptr);
 
   template <typename T>
@@ -172,7 +172,7 @@
     js_free(p);
   }
 
-  JS_FRIEND_API void reportAllocOverflow() const;
+  void reportAllocOverflow() const;
 
   bool checkSimulatedOOM() const {
     if (js::oom::ShouldFailWithOOM()) {

