Closed jfrux closed 11 years ago
Hmm, yeah I had problems with Railo's "this" scope handling as well. The work-around it in Underscore.cfc was to pass in "this" as an argument to the iterator functions. I'd love to get rid of that hack, so let me know how it goes on the Railo group!
Would you sometime be able to do me a favor...? I'd love it if you could make a branch without the "railo hack" so I can submit this entire library to them along with the unit test results so they can see all the places Railo fails with UnderscoreCF?
Would that info be evident in the tests?
Sure! You can actually see it already if you just look at the history. Version 1.x.x fails in Railo due to this issue.
See 230ced37fc1cacf0296ee9ebf11b55d12b4ed1a7 (browse it: https://github.com/russplaysguitar/UnderscoreCF/tree/230ced37fc1cacf0296ee9ebf11b55d12b4ed1a7)
Okay, I just posted an issue with the Railo Group about the "this" scope and whether or not I'm approprately using it lmao...
Here is my post, let me know if you think I'm just a n00b or if it should behave this way.
I have some concerns with components that implement other components potentially losing site of the "this" scope. Maybe it's just something with my code but the best way I can explain it is with pseudo-code for now. That's all I have time for. It could be 'just me' but I figured I would share in case I'm doing something wrong.
Let's say we have 1 cfc, we'll call it "utilities.cfc" which has the following code:
THEN, we have another CFC that uses this utilities.cfc, we'll call it 'worker.cfc' which has code like such...
Is this normal behavior? am I just stupid? :D I mean, I assume the reason it's acting this way is because 'doerFunc' is passed as a function expression to the utilities.cfc function which now executes it under it's own scope but is this intentional? Should this work this way?
I'll try to get a real test case up as soon as I can.
Please advise.
Sincerely, Joshua F. Rountree