diff --git a/changelog.md b/changelog.md index 9d0c046..b34a807 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- When calling `getMetadata()` with a `DynamicObject` make sure the class is unwrapped + +## [1.14.0] - 2024-12-10 + +### Fixed + - Pre-seed `clientManagement` setting to `false` to avoid issues with Adobe/Lucee CFML engines ## [1.13.0] - 2024-12-10 diff --git a/gradle.properties b/gradle.properties index 8293954..9553430 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -#Tue Dec 10 21:15:07 UTC 2024 +#Tue Dec 10 21:54:51 UTC 2024 boxlangVersion=1.0.0-snapshot jdkVersion=21 -version=1.14.0 +version=1.15.0 group=ortus.boxlang diff --git a/src/main/java/ortus/boxlang/modules/compat/bifs/system/GetMetaData.java b/src/main/java/ortus/boxlang/modules/compat/bifs/system/GetMetaData.java index b72cb1d..4432576 100644 --- a/src/main/java/ortus/boxlang/modules/compat/bifs/system/GetMetaData.java +++ b/src/main/java/ortus/boxlang/modules/compat/bifs/system/GetMetaData.java @@ -19,14 +19,15 @@ import ortus.boxlang.runtime.bifs.BIF; import ortus.boxlang.runtime.bifs.BoxBIF; import ortus.boxlang.runtime.context.IBoxContext; +import ortus.boxlang.runtime.interop.DynamicObject; import ortus.boxlang.runtime.runnables.IClassRunnable; import ortus.boxlang.runtime.scopes.ArgumentsScope; import ortus.boxlang.runtime.scopes.Key; import ortus.boxlang.runtime.types.Argument; +import ortus.boxlang.runtime.types.Array; import ortus.boxlang.runtime.types.Function; import ortus.boxlang.runtime.types.Query; import ortus.boxlang.runtime.types.QueryColumn; -import ortus.boxlang.runtime.types.Array; import ortus.boxlang.runtime.types.Struct; @BoxBIF @@ -54,6 +55,15 @@ public GetMetaData() { public Object _invoke( IBoxContext context, ArgumentsScope arguments ) { Object value = arguments.get( Key.value ); + // DynamicObject instances need to be unwrapped to get the metadata + if ( value instanceof DynamicObject dynamicObject ) { + if ( dynamicObject.hasInstance() ) { + value = dynamicObject.unWrap(); + } else { + value = dynamicObject.invokeConstructor( context ).unWrap(); + } + } + // Functions have a legacy metadata view that matches CF engines if ( value instanceof Function fun ) { return fun.getMetaData();