wasm gc: fix issue with detection of native byte order in NIO emulation

This commit is contained in:
Alexey Andreev 2024-10-23 18:10:10 +02:00
parent c56f5be2d9
commit d29b436fa5

View File

@ -33,7 +33,7 @@ public final class TByteOrder {
public static TByteOrder nativeOrder() {
if (nativeOrder == null) {
if (PlatformDetector.isJavaScript()) {
if (PlatformDetector.isJavaScript() || PlatformDetector.isWebAssemblyGC()) {
var buffer = new ArrayBuffer(2);
var shortArray = new Int16Array(buffer);
shortArray.set(0, (short) 1);