diff --git a/js/src/jsobj.h b/js/src/jsobj.h index 6a673ac69801..48794691bd0d 100644 --- a/js/src/jsobj.h +++ b/js/src/jsobj.h @@ -393,8 +393,10 @@ struct JSObject { static const uint32 JSSLOT_ARRAY_COUNT = JSSLOT_PRIVATE + 1; static const uint32 JSSLOT_ARRAY_UNUSED = JSSLOT_PRIVATE + 2; - // This must remain true; see comment in js_MakeArraySlow(). - JS_STATIC_ASSERT(JSSLOT_ARRAY_LENGTH == JSSLOT_PRIVATE); + // This assertion must remain true; see comment in js_MakeArraySlow(). + // (Nb: This method is never called, it just contains a static assertion. + // The static assertion isn't inline because that doesn't work on Mac.) + inline void staticAssertArrayLengthIsInPrivateSlot(); public: inline uint32 getArrayLength() const; diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h index 5265e837557c..eec0fb2579bc 100644 --- a/js/src/jsobjinlines.h +++ b/js/src/jsobjinlines.h @@ -81,6 +81,11 @@ JSObject::setSlotMT(JSContext *cx, uintN slot, jsval value) #endif } +inline void JSObject::staticAssertArrayLengthIsInPrivateSlot() +{ + JS_STATIC_ASSERT(JSSLOT_ARRAY_LENGTH == JSSLOT_PRIVATE); +} + inline uint32 JSObject::getArrayLength() const {