cfc icon indicating copy to clipboard operation
cfc copied to clipboard

Syntax checker digs too deep into Java blocks

Open michaelalandawson opened this issue 2 years ago • 0 comments

In the following code, the "return" statement is flagged as an error:

A return statement must be contained inside a function body. cfls

Maybe the syntax checker should ignore the code inside java{} and <cfjava /> blocks?

Thanks!

<cfscript>
instance = java {
	import java.math.BigDecimal;
	import com.braintreegateway.*;

	public class Braintree {

		public static BraintreeGateway getGateway() {
			BraintreeGateway gateway = new BraintreeGateway(
				Environment.SANDBOX,
				"xxx",
				"xxx",
				"xxx"
			);

			return gateway;
		}

	}
}
</cfscript>

image

michaelalandawson avatar Mar 13 '23 23:03 michaelalandawson