Skip to content

Commit

Permalink
Should fix records ignoring type wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
LatvianModder committed Jul 22, 2024
1 parent 518eb7b commit b111e50
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/dev/latvian/mods/rhino/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -1461,10 +1461,6 @@ protected Object internalJsToJava(Object from, TypeInfo target) {

Object unwrappedValue = Wrapper.unwrapped(from);

if (unwrappedValue instanceof TypeWrapperFactory<?> f) {
return f.wrap(this, unwrappedValue, target);
}

var typeWrapper = factory.getTypeWrappers().getWrapperFactory(unwrappedValue, target);

if (typeWrapper != null) {
Expand Down Expand Up @@ -1580,6 +1576,10 @@ protected Object internalJsToJava(Object from, TypeInfo target) {
}

protected Object internalJsToJavaLast(Object from, TypeInfo target) {
if (target instanceof TypeWrapperFactory<?> f) {
return f.wrap(this, from, target);
}

return reportConversionError(from, target);
}

Expand Down

0 comments on commit b111e50

Please sign in to comment.