Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn or error when using the "caller" scope #722

Open
tingar opened this issue Dec 8, 2023 · 0 comments
Open

Warn or error when using the "caller" scope #722

tingar opened this issue Dec 8, 2023 · 0 comments

Comments

@tingar
Copy link

tingar commented Dec 8, 2023

The caller scope is a serious footgun since it breaks encapsulation and allows a custom tag to modify its calling code. It would be great if CFLint could throw a warning or error when using this scope.

From Adobe's scope documentation [1]:

Used only in custom tag pages. The custom tag's Caller scope is a reference to the calling page's Variables scope. Any variables that you create or change in the custom tag page using the Caller scope are visible in the calling page's Variables scope. For more information, see Creating and Using Custom CFML Tags.

There are also differences between Adobe and Lucee implementations [2], so it's best avoided for compatibility reasons as well.

1: https://helpx.adobe.com/coldfusion/developing-applications/the-cfml-programming-language/using-coldfusion-variables/about-scopes.html
2: https://www.bennadel.com/blog/3995-divergent-caller-scope-assignment-behavior-in-adobe-coldfusion-and-lucee-cfml-5-3-7-48.htm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant