You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Graal 19.3, getMetaObject returned a meta object, and we could check if a Value was a module using value.getMetaObject().toString().equals("Module"). In Graal 20.x, getMetaObject returns null, so have to check if a Value is a module using value.toString().equals("[Module]").
This change broke our code in several places. Was the change in behavior intentional?
Here is a failing Groovy test that demonstrates the issue:
@Test
void "Value#getMetaObject returns a non null value for an ES module"() {
def vfs = new PolyglotInMemoryOnlyFileSystem()
context = Context.newBuilder("js")
.allowHostAccess(true)
.option("js.ecmascript-version", "11") // ES2020 is required for import() call support
.allowIO(true)
.fileSystem(vfs)
.build()
addModule(vfs, "export function howGreat() { return 'funktastic!'; }", "funky/index")
Source importSource = Source.newBuilder("js", "import * as Module from 'funky';\n" + "Module;\n", "funky.mjs")
.build()
def module = context.eval(importSource)
// The below assertion fails on Graal 20.x.
assert module.getMetaObject() != null
}
The text was updated successfully, but these errors were encountered:
In Graal 19.3, getMetaObject returned a meta object, and we could check if a Value was a module using value.getMetaObject().toString().equals("Module"). In Graal 20.x, getMetaObject returns null, so have to check if a Value is a module using value.toString().equals("[Module]").
This change broke our code in several places. Was the change in behavior intentional?
Here is a failing Groovy test that demonstrates the issue:
The text was updated successfully, but these errors were encountered: