Issues
- ORM lambda invocations receive wrong `this` scopeLDEV-4067Michael Offner
- Arrow function with no body errors in Lucee, but not in AdobeLDEV-4062Michael Offner
- isStruct() returns true for lambda callbackLDEV-4054Resolved issue: LDEV-4054Pothys - MitrahSoft
- thread statement cannot be used inside an arrow functionLDEV-3914Michael Offner
- Can't call UDFs stored in an array inlineLDEV-2489
- Implicit return for last expression in lambda?LDEV-1621Michael Offner
- Strange behaviour of lambdas depending on curly brackets and return keywordLDEV-1484Michael Offner
7 of 7
ORM lambda invocations receive wrong `this` scope
Description
Environment
None
Attachments
4
Details
Assignee
Michael OffnerMichael OffnerReporter
Michael Born @ OrtusMichael Born @ OrtusPriority
NewNew Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Michael Born @ Ortus
Michael Born @ OrtusPriority
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Created 7 July 2022 at 18:35
Updated 23 August 2022 at 05:29
Activity
Show:
Pothys - MitrahSoft23 August 2022 at 05:28Edited
Disabled testcase
Michael Born @ Ortus11 July 2022 at 12:51
Thanks for the test case !
Pothys - MitrahSoft8 July 2022 at 14:45
I've checked this ticket with the above test file and confirmed the issue happened on the lucee latest version 5.3.10.27-SNAPSHOT. When calling a lambda/closure within an ORM entity, this/variables scope returns the wrong value. Seems ACF returns the this/variables scope value from lambda/closure.
I added a testcase to this ticket
Pull Request:
When calling a lambda within an ORM entity, the lambda’s
this
scope andvariables
scope refer to an unpopulated entity. i.e. it is impossible to reference entity properties within a closure, even after setting the property on the entity beforehand.Take this code:
when run without ORM population involved, we get the name back:
"Michael"
.But when run as an ORM entity, the name is always
NULL
:See the attached .zip file test case, or screenshots comparing behavior between Lucee and ACF. (ACF outputs
"Michael"
property value in both the native component test and the ORM entity test.)