cflint / CFLint

Static code analysis for CFML (a linter)
BSD 3-Clause "New" or "Revised" License
174 stars 84 forks source link

Add support for static accessor operator (`::`) #700

Open cybersonic opened 3 years ago

cybersonic commented 3 years ago

Lucee allows the ability to have static functions in components, i.e. calling a function without having to instantiate the Component itself (see https://docs.lucee.org/guides/cookbooks/StaticScope.html )

The syntax breaks CFLint parsing and brings false positives in parsing:

<cfscript>
isValid = com.domain.services.Service::isUserValid(userid);
</cfscript>

This throws a: Critical: End of statement(;) expected after Service

error

KamasamaK commented 3 years ago

This is also supported as of ColdFusion 2021, so no longer Lucee-exclusive.

https://helpx.adobe.com/coldfusion/developing-applications/building-blocks-of-coldfusion-applications/building-and-using-coldfusion-components/cfc-variables-and-scope.ug.html#static-support

cybersonic commented 3 years ago

Cool, so it is not just Lucee then. Great!

zspitzer commented 3 years ago

The latest Lucee 5.3.8 also supports calling static functions via dot syntax https://luceeserver.atlassian.net/browse/LDEV-3334