Fixed Echo bug with attr only being resolved on itself.

This commit is contained in:
JesseBrault0709 2024-05-12 11:56:10 +02:00
parent e22fc1622e
commit a2c6b787f7
2 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,4 @@
--- ---
import groowt.view.web.lib.Echo import groowt.view.web.lib.Echo
--- ---
<Echo greeting=${cliGreeting}><p>$greeting</p></Echo> <Echo><p>$cliGreeting</p></Echo>

View File

@ -15,8 +15,12 @@ class Echo extends DelegatingWebViewComponent {
Object getProperty(String propertyName) { Object getProperty(String propertyName) {
try { try {
return super.getProperty(propertyName) return super.getProperty(propertyName)
} catch (MissingPropertyException ignored) { } catch (MissingPropertyException missingPropertyException) {
return attr[propertyName] if (this.attr.containsKey(propertyName)) {
return this.attr[propertyName]
} else {
throw missingPropertyException
}
} }
} }