@@ -38,7 +38,7 @@ Modern mode offers several advantages:
3838
3939Consider this component when running in Classic mode:
4040
41- ``` javascript
41+ ``` cfml
4242component {
4343 function createToken(id) {
4444 token = createUUID(); // Stored in variables scope
7676
7777### 3. Application Level (Application.cfc)
7878
79- ``` javascript
79+ ``` cfml
8080this.localMode = "modern"; // or "classic"
8181```
8282
8383### 4. Function Level
8484
85- ``` javascript
85+ ``` cfml
8686function test() localMode="modern" {
8787 // Function body
8888}
@@ -134,25 +134,25 @@ Variable Scope Cascading Write Detected: The variable [token] is being implicitl
134134
135135For each occurrence, decide whether to:
136136
137- 1 . ** Add explicit variables scope** (if the variable should remain in the component's variables scope):
137+ 1 . ** Add explicit ` variables ` scope** (if the variable should remain in the component's variables scope):
138138
139- ``` javascript
140- variables .token = createUUID ();
141- ```
139+ ``` cfml
140+ variables.token = createUUID();
141+ ```
142142
143- 2. ** Add explicit local scope** (if the variable should be function -local):
143+ 2 . ** Add explicit ` local ` scope** (if the variable should be function-local):
144144
145- ```javascript
146- local.token = createUUID();
147- ```
145+ ``` cfml
146+ local.token = createUUID();
147+ ```
148148
149149### Common Patterns Requiring Attention
150150
151151#### Component Properties
152152
153153Properties meant to be stored at the component level need an explicit variables scope:
154154
155- ```javascript
155+ ``` cfml
156156// Before
157157function init(datasourceName) {
158158 datasourceName = arguments.datasourceName;
@@ -168,7 +168,7 @@ function init(datasourceName) {
168168
169169Variables that should be local to a function call:
170170
171- ` ` ` javascript
171+ ``` cfml
172172// Before
173173function processItems(items) {
174174 result = [];
0 commit comments