Skip to content

Commit

Permalink
make sure specific type converters are attempted in specific exceptio…
Browse files Browse the repository at this point in the history
…n type ToEspresso nodes

(cherry picked from commit 70e7668)
  • Loading branch information
javeleon authored and elkorchi committed Jun 26, 2024
1 parent 166a709 commit 3e65683
Showing 1 changed file with 27 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1857,9 +1857,16 @@ public StaticObject doEspressoException(EspressoException value) {
"interop.isException(value)",
"!isEspressoException(value)"
})
StaticObject doforeign(Object value,
StaticObject doForeign(Object value,
@CachedLibrary(limit = "LIMIT") InteropLibrary interop,
@Bind("getContext()") EspressoContext context) {
@Cached LookupTypeConverterNode lookupTypeConverterNode,
@Cached LookupInternalTypeConverterNode lookupInternalTypeConverterNode,
@Cached ToReference.DynamicToReference converterToEspresso,
@Bind("getContext()") EspressoContext context) throws UnsupportedTypeException {
StaticObject result = ToReference.tryConverterForUnknownTarget(value, interop, lookupTypeConverterNode, lookupInternalTypeConverterNode, converterToEspresso, context.getMeta());
if (result != null) {
return result;
}
return StaticObject.createForeignException(context, value, interop);
}

Expand Down Expand Up @@ -1908,9 +1915,16 @@ public StaticObject doEspressoException(EspressoException value, @Bind("getMeta(
"interop.isException(value)",
"!isEspressoException(value)"
})
StaticObject doforeign(Object value,
StaticObject doForeign(Object value,
@CachedLibrary(limit = "LIMIT") InteropLibrary interop,
@Bind("getContext()") EspressoContext context) {
@Cached LookupTypeConverterNode lookupTypeConverterNode,
@Cached LookupInternalTypeConverterNode lookupInternalTypeConverterNode,
@Cached ToReference.DynamicToReference converterToEspresso,
@Bind("getContext()") EspressoContext context) throws UnsupportedTypeException {
StaticObject result = ToReference.tryConverterForUnknownTarget(value, interop, lookupTypeConverterNode, lookupInternalTypeConverterNode, converterToEspresso, context.getMeta());
if (result != null) {
return result;
}
return StaticObject.createForeignException(context, value, interop);
}

Expand Down Expand Up @@ -1959,9 +1973,16 @@ public StaticObject doEspressoException(EspressoException value, @Bind("getMeta(
"interop.isException(value)",
"!isEspressoException(value)"
})
StaticObject doforeign(Object value,
StaticObject doForeign(Object value,
@CachedLibrary(limit = "LIMIT") InteropLibrary interop,
@Bind("getContext()") EspressoContext context) {
@Bind("getContext()") EspressoContext context,
@Cached LookupTypeConverterNode lookupTypeConverterNode,
@Cached LookupInternalTypeConverterNode lookupInternalTypeConverterNode,
@Cached ToReference.DynamicToReference converterToEspresso) throws UnsupportedTypeException {
StaticObject result = ToReference.tryConverterForUnknownTarget(value, interop, lookupTypeConverterNode, lookupInternalTypeConverterNode, converterToEspresso, context.getMeta());
if (result != null) {
return result;
}
return StaticObject.createForeignException(context, value, interop);
}

Expand Down

0 comments on commit 3e65683

Please sign in to comment.