diff --git a/js/src/gc/Cell.h b/js/src/gc/Cell.h index b9243e0898..fde676f5d3 100644 --- a/js/src/gc/Cell.h +++ b/js/src/gc/Cell.h @@ -246,7 +246,11 @@ Cell::storeBuffer() const inline JS::TraceKind Cell::getTraceKind() const { - return isTenured() ? asTenured().getTraceKind() : JS::TraceKind::Object; + if (isTenured()) + return asTenured().getTraceKind(); + if (js::shadow::String::nurseryCellIsString(this)) + return JS::TraceKind::String; + return JS::TraceKind::Object; } /* static */ MOZ_ALWAYS_INLINE bool