Skip to content

Commit

Permalink
[GR-48651] Ensure that DefaultStackTraceElementObject satisfies the c…
Browse files Browse the repository at this point in the history
…ontract of InteropLibrary

PullRequest: graal/15580
  • Loading branch information
jchalou committed Sep 25, 2023
2 parents 0d620f8 + bb108fa commit 2ae69a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ boolean hasExecutableName() {

@ExportMessage
@TruffleBoundary
Object getExecutableName() {
return rootNode.getName();
Object getExecutableName() throws UnsupportedMessageException {
String name = rootNode.getName();
if (name == null) {
throw UnsupportedMessageException.create();
}
return name;
}

@ExportMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ static void verifyStackTraceElementGuestObject(Object guestObject) throws Unsupp
if (interop.hasExecutableName(guestObject)) {
Object executableName = interop.getExecutableName(guestObject);
Assert.assertTrue(interop.isString(executableName));
} else {
AbstractPolyglotTest.assertFails(() -> interop.getExecutableName(guestObject), UnsupportedMessageException.class);
}
if (interop.hasDeclaringMetaObject(guestObject)) {
Object metaObject = interop.getDeclaringMetaObject(guestObject);
Expand Down

0 comments on commit 2ae69a8

Please sign in to comment.