var scoping and module calls in a cfc [duplicate]

a 夏天 提交于 2019-12-06 11:38:13

Ok, apparently this wasn't as hard to test as I was making it out to be (thanks David Faber for the suggestion). By dumping out the variables scope in the cfc, we can easily see if the cfmodule call is "polluting" the cfc's variables scope. This occurs when the cfmodule uses its own caller scope.

As it turns out, this is easily remedied by "var scoping" any problematic variables in the method before making the cfmodule call. Indeed, this does the trick of preventing the cfmodule variables from bleeding through.

Without the var scoped variables in the method, the bleed over does indeed occur (as expected). This was my hunch, but I wanted to be totally sure considering the implications. Thanks!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!