servo / mozjs

Servo's SpiderMonkey fork
244 stars 114 forks source link

Impl byte_size on Scalar::Type #499

Closed sagudev closed 1 month ago

sagudev commented 1 month ago

This implements https://searchfox.org/mozilla-central/source/js/public/ScalarType.h#66, but we return None for Type::MaxTypedArrayViewType instead of crashing. This is much more safer then what is done in mozilla (see https://hg.mozilla.org/mozilla-central/rev/52377aae89ab697c60f663c36168e40f8e9445a4 for ex)