()
| 1157 | level.push(-10); |
| 1158 | }, |
| 1159 | reference = function beautify_script_level_reference():void { |
| 1160 | const hoist = function beautify_script_level_reference_hoist():void { |
| 1161 | let func:number = data.begin[a]; |
| 1162 | if (func < 0) { |
| 1163 | scopes.push([data.token[a], -1]); |
| 1164 | } else { |
| 1165 | if (data.stack[func + 1] !== "function") { |
| 1166 | do { |
| 1167 | func = data.begin[func]; |
| 1168 | } while (func > -1 && data.stack[func + 1] !== "function"); |
| 1169 | } |
| 1170 | scopes.push([data.token[a], func]); |
| 1171 | } |
| 1172 | }; |
| 1173 | if (ltype !== "separator" && ltype !== "start" && ltype !== "end" && ltype.indexOf("template_string") < 0) { |
| 1174 | if (ltype === "word" || ltype === "operator") { |
| 1175 | level[a - 1] = -10; |
| 1176 | } else { |
| 1177 | level[a - 1] = -20; |
| 1178 | } |
| 1179 | } |
| 1180 | if (ltoke === "var" && data.lexer[a - 1] === lexer) { |
| 1181 | // hoisted references following declaration keyword |
| 1182 | hoist(); |
| 1183 | } else if (ltoke === "function") { |
| 1184 | scopes.push([data.token[a], a]); |
| 1185 | } else if (ltoke === "let" || ltoke === "const") { |
| 1186 | // not hoisted references following declaration keyword |
| 1187 | scopes.push([data.token[a], a]); |
| 1188 | } else if (data.stack[a] === "arguments") { |
| 1189 | scopes.push([data.token[a], a]); |
| 1190 | } else if (ltoke === ",") { |
| 1191 | // references following a comma, must be tested to see if a declaration list |
| 1192 | let index:number = a; |
| 1193 | do { |
| 1194 | index = index - 1; |
| 1195 | } while (index > data.begin[a] && data.token[index] !== "var" && data.token[index] !== "let" && data.token[index] !== "const"); |
| 1196 | if (data.token[index] === "var") { |
| 1197 | hoist(); |
| 1198 | } else if (data.token[index] === "let" || data.token[index] === "const") { |
| 1199 | scopes.push([data.token[a], a]); |
| 1200 | } |
| 1201 | } |
| 1202 | level.push(-10); |
| 1203 | }, |
| 1204 | separator = function beautify_script_level_separator():void { |
| 1205 | let methtest:boolean = false; |
| 1206 | const ei:number[] = (extraindent[extraindent.length - 1] === undefined) |
no test coverage detected