Bug 1896505 - Document IsArraySpecies r=jandem

Differential Revision: https://phabricator.services.mozilla.com/D210531
This commit is contained in:
Matthew Gaudet 2024-05-29 19:14:10 +00:00
parent 8f69b34496
commit da6e4c1280

View File

@ -983,6 +983,11 @@ bool js::IsCrossRealmArrayConstructor(JSContext* cx, JSObject* obj,
return true;
}
// Returns true iff we know for -sure- that it is definitely safe to use the
// realm's array constructor.
//
// This function is conservative as it may return false for cases which
// ultimately do use the array constructor.
static MOZ_ALWAYS_INLINE bool IsArraySpecies(JSContext* cx,
HandleObject origArray) {
if (MOZ_UNLIKELY(origArray->is<ProxyObject>())) {