From d29b436fa539c955a4a8e64ca2fa31ce3a44017e Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Wed, 23 Oct 2024 18:10:10 +0200 Subject: [PATCH] wasm gc: fix issue with detection of native byte order in NIO emulation --- .../src/main/java/org/teavm/classlib/java/nio/TByteOrder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classlib/src/main/java/org/teavm/classlib/java/nio/TByteOrder.java b/classlib/src/main/java/org/teavm/classlib/java/nio/TByteOrder.java index bc3ca6a1d..f88285b7b 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/nio/TByteOrder.java +++ b/classlib/src/main/java/org/teavm/classlib/java/nio/TByteOrder.java @@ -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);