mirror of
https://github.com/enso-org/enso.git
synced 2024-11-27 14:32:52 +03:00
Make sure isDate and asDate messages are properly propagated
This commit is contained in:
parent
1225591cd7
commit
d063b6617f
@ -15,6 +15,7 @@ import com.oracle.truffle.api.library.CachedLibrary;
|
||||
import com.oracle.truffle.api.library.ExportLibrary;
|
||||
import com.oracle.truffle.api.library.ExportMessage;
|
||||
import com.oracle.truffle.api.profiles.BranchProfile;
|
||||
import java.time.LocalDate;
|
||||
import org.enso.interpreter.epb.node.ContextRewrapExceptionNode;
|
||||
import org.enso.interpreter.epb.node.ContextRewrapNode;
|
||||
|
||||
@ -909,4 +910,29 @@ public class PolyglotProxy implements TruffleObject {
|
||||
leaveOrigin(node, p);
|
||||
}
|
||||
}
|
||||
|
||||
@ExportMessage
|
||||
boolean isDate(
|
||||
@CachedLibrary("this.delegate") InteropLibrary datum,
|
||||
@CachedLibrary("this") InteropLibrary node) {
|
||||
Object p = enterOrigin(node);
|
||||
try {
|
||||
return datum.isDate(delegate);
|
||||
} finally {
|
||||
leaveOrigin(node, p);
|
||||
}
|
||||
}
|
||||
|
||||
@ExportMessage
|
||||
LocalDate asDate(
|
||||
@CachedLibrary("this.delegate") InteropLibrary datume,
|
||||
@CachedLibrary("this") InteropLibrary node)
|
||||
throws UnsupportedMessageException {
|
||||
Object p = enterOrigin(node);
|
||||
try {
|
||||
return datume.asDate(delegate);
|
||||
} finally {
|
||||
leaveOrigin(node, p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user