Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
konsoletyper committed Sep 28, 2024
1 parent 5ad4496 commit e966690
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ final boolean isEmptyMonitor() {
if (monitor == null) {
return true;
}
if (PlatformDetector.isWebAssemblyGC()) {
// TODO: fix Monitor implementation and remove this block
return monitor.owner == null;
}
if (monitor.owner == null
&& (monitor.enteringThreads == null || monitor.enteringThreads.isEmpty())
&& (monitor.notifyListeners == null || monitor.notifyListeners.isEmpty())) {
Expand Down
8 changes: 6 additions & 2 deletions jso/impl/src/main/java/org/teavm/jso/impl/JSOPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
public class JSOPlugin implements TeaVMPlugin {
@Override
public void install(TeaVMHost host) {
var jsHost = host.getExtension(TeaVMJavaScriptHost.class);
var wasmGCHost = host.getExtension(TeaVMWasmGCHost.class);
if (jsHost == null && wasmGCHost == null) {
return;
}

JSBodyRepository repository = new JSBodyRepository();
host.registerService(JSBodyRepository.class, repository);
host.add(new JSObjectClassTransformer(repository));
Expand All @@ -48,12 +54,10 @@ public void install(TeaVMHost host) {

TeaVMPluginUtil.handleNatives(host, JS.class);

var jsHost = host.getExtension(TeaVMJavaScriptHost.class);
if (jsHost != null) {
installForJS(jsHost);
}

var wasmGCHost = host.getExtension(TeaVMWasmGCHost.class);
if (wasmGCHost != null) {
WasmGCJso.install(host, wasmGCHost, repository);
}
Expand Down

0 comments on commit e966690

Please sign in to comment.