| 1 | import { type PluginPassscip-typescript npm @babel/core 7.20.12 src/transformation/`plugin-pass.ts`/PluginPass#, template, types as tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/ } from "@babel/core"scip-typescript npm @babel/core 7.20.12 src/`index.ts`/; |
| 2 | import type { NodePathscip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath# } from "@babel/traverse"scip-typescript npm @babel/traverse 7.20.13 src/`index.ts`/; |
| 3 | |
| 4 | // This is the legacy implementation, which inlines all the code. |
| 5 | // It must be kept for compatibility reasons. |
| 6 | // TODO (Babel 8): Remove this code. |
| 7 | |
| 8 | export default function transformWithoutHelperscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/transformWithoutHelper().( |
| 9 | loosescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/transformWithoutHelper().(loose): boolean | void, |
| 10 | pathscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/transformWithoutHelper().(path): NodePathscip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath#<tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.ForOfStatementscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/ForOfStatement#>, |
| 11 | statescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/transformWithoutHelper().(state): PluginPassscip-typescript npm @babel/core 7.20.12 src/transformation/`plugin-pass.ts`/PluginPass#, |
| 12 | ) { |
| 13 | const pushComputedProps = loosescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/transformWithoutHelper().(loose) |
| 14 | ? pushComputedPropsLoosescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/pushComputedPropsLoose(). |
| 15 | : pushComputedPropsSpecscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/pushComputedPropsSpec().; |
| 16 | |
| 17 | const { nodescip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath#node. } = pathscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/transformWithoutHelper().(path); |
| 18 | const build = pushComputedProps(pathscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/transformWithoutHelper().(path), statescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/transformWithoutHelper().(state)); |
| 19 | const declar = build.declarscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/declar0:; |
| 20 | const loop = build.loopscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/loop0:; |
| 21 | const block = loop.bodyscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/ForStatement#body. as tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.BlockStatementscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/BlockStatement#; |
| 22 | |
| 23 | // ensure that it's a block so we can take all its statements |
| 24 | pathscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/transformWithoutHelper().(path).ensureBlockscip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath#ensureBlock().(); |
| 25 | |
| 26 | // add the value declaration to the new loop body |
| 27 | if (declar) { |
| 28 | block.bodyscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/BlockStatement#body..pushscip-typescript npm typescript 5.9.3 lib/`lib.es5.d.ts`/Array#push().(declar); |
| 29 | } |
| 30 | |
| 31 | // push the rest of the original loop body onto our new body |
| 32 | block.bodyscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/BlockStatement#body..pushscip-typescript npm typescript 5.9.3 lib/`lib.es5.d.ts`/Array#push().(...(node.bodyscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/ForOfStatement#body. as tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.BlockStatementscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/BlockStatement#).bodyscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/BlockStatement#body.); |
| 33 | |
| 34 | tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.inherits(loop, node); |
| 35 | tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.inherits(loop.bodyscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/ForStatement#body., node.bodyscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/ForOfStatement#body.); |
| 36 | |
| 37 | if (build.replaceParentscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/replaceParent0:) { |
| 38 | pathscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/transformWithoutHelper().(path).parentPathscip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath#parentPath..replaceWithMultiplescip-typescript npm @babel/traverse 7.20.13 src/path/`replacement.ts`/replaceWithMultiple().(build.nodescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/node0:); |
| 39 | pathscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/transformWithoutHelper().(path).removescip-typescript npm @babel/traverse 7.20.13 src/path/`removal.ts`/remove().(); |
| 40 | } else { |
| 41 | pathscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/transformWithoutHelper().(path).replaceWithMultiplescip-typescript npm @babel/traverse 7.20.13 src/path/`replacement.ts`/replaceWithMultiple().(build.nodescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/node0:); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | const buildForOfLoosescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/buildForOfLoose. = template.statementscip-typescript npm @babel/template 7.20.7 src/`index.ts`/statement0:(` |
| 46 | for (var LOOP_OBJECT = OBJECT, |
| 47 | IS_ARRAY = Array.isArray(LOOP_OBJECT), |
| 48 | INDEX = 0, |
| 49 | LOOP_OBJECT = IS_ARRAY ? LOOP_OBJECT : LOOP_OBJECT[Symbol.iterator]();;) { |
| 50 | INTERMEDIATE; |
| 51 | if (IS_ARRAY) { |
| 52 | if (INDEX >= LOOP_OBJECT.length) break; |
| 53 | ID = LOOP_OBJECT[INDEX++]; |
| 54 | } else { |
| 55 | INDEX = LOOP_OBJECT.next(); |
| 56 | if (INDEX.done) break; |
| 57 | ID = INDEX.value; |
| 58 | } |
| 59 | } |
| 60 | `); |
| 61 | |
| 62 | const buildForOfscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/buildForOf. = template.statementsscip-typescript npm @babel/template 7.20.7 src/`index.ts`/statements0:(` |
| 63 | var ITERATOR_COMPLETION = true; |
| 64 | var ITERATOR_HAD_ERROR_KEY = false; |
| 65 | var ITERATOR_ERROR_KEY = undefined; |
| 66 | try { |
| 67 | for ( |
| 68 | var ITERATOR_KEY = OBJECT[Symbol.iterator](), STEP_KEY; |
| 69 | !(ITERATOR_COMPLETION = (STEP_KEY = ITERATOR_KEY.next()).done); |
| 70 | ITERATOR_COMPLETION = true |
| 71 | ) {} |
| 72 | } catch (err) { |
| 73 | ITERATOR_HAD_ERROR_KEY = true; |
| 74 | ITERATOR_ERROR_KEY = err; |
| 75 | } finally { |
| 76 | try { |
| 77 | if (!ITERATOR_COMPLETION && ITERATOR_KEY.return != null) { |
| 78 | ITERATOR_KEY.return(); |
| 79 | } |
| 80 | } finally { |
| 81 | if (ITERATOR_HAD_ERROR_KEY) { |
| 82 | throw ITERATOR_ERROR_KEY; |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | `); |
| 87 | |
| 88 | function pushComputedPropsLoosescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/pushComputedPropsLoose().( |
| 89 | pathscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/pushComputedPropsLoose().(path): NodePathscip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath#<tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.ForOfStatementscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/ForOfStatement#>, |
| 90 | statescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/pushComputedPropsLoose().(state): PluginPassscip-typescript npm @babel/core 7.20.12 src/transformation/`plugin-pass.ts`/PluginPass#, |
| 91 | ) { |
| 92 | const { nodescip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath#node., scopescip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath#scope., parentscip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath#parent. } = pathscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/pushComputedPropsLoose().(path); |
| 93 | const { leftscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/ForOfStatement#left. } = node; |
| 94 | let declar, id, intermediate; |
| 95 | |
| 96 | if (tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.isIdentifierscip-typescript npm @babel/types 7.20.7 src/validators/generated/`index.ts`/isIdentifier().(left) || tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.isPatternscip-typescript npm @babel/types 7.20.7 src/validators/generated/`index.ts`/isPattern().(left) || tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.isMemberExpressionscip-typescript npm @babel/types 7.20.7 src/validators/generated/`index.ts`/isMemberExpression().(left)) { |
| 97 | // for (i of test), for ({ i } of test) |
| 98 | id = left; |
| 99 | intermediate = null; |
| 100 | } else if (tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.isVariableDeclarationscip-typescript npm @babel/types 7.20.7 src/validators/generated/`index.ts`/isVariableDeclaration().(left)) { |
| 101 | // for (let i of test) |
| 102 | id = scope.generateUidIdentifierscip-typescript npm @babel/traverse 7.20.13 src/scope/`index.ts`/Scope#generateUidIdentifier().("ref"); |
| 103 | declar = tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.variableDeclarationscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/variableDeclaration().(left.kindscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/VariableDeclaration#kind., [ |
| 104 | tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.variableDeclaratorscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/variableDeclarator().(left.declarationsscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/VariableDeclaration#declarations.[0].idscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/VariableDeclarator#id., tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.identifierscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/identifier().(id.namescip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/Identifier#name.)), |
| 105 | ]); |
| 106 | intermediate = tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.variableDeclarationscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/variableDeclaration().("var", [ |
| 107 | tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.variableDeclaratorscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/variableDeclarator().(tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.identifierscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/identifier().(id.namescip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/Identifier#name.)), |
| 108 | ]); |
| 109 | } else { |
| 110 | throw statescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/pushComputedPropsLoose().(state).buildCodeFrameErrorscip-typescript npm @babel/core 7.20.12 src/transformation/`plugin-pass.ts`/PluginPass#buildCodeFrameError().( |
| 111 | left, |
| 112 | `Unknown node type ${left.typescip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/RestElement#type.} in ForStatement`, |
| 113 | ); |
| 114 | } |
| 115 | |
| 116 | const iteratorKey = scope.generateUidIdentifierscip-typescript npm @babel/traverse 7.20.13 src/scope/`index.ts`/Scope#generateUidIdentifier().("iterator"); |
| 117 | const isArrayKey = scope.generateUidIdentifierscip-typescript npm @babel/traverse 7.20.13 src/scope/`index.ts`/Scope#generateUidIdentifier().("isArray"); |
| 118 | |
| 119 | const loop = buildForOfLoosescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/buildForOfLoose.({ |
| 120 | LOOP_OBJECTscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/LOOP_OBJECT0:: iteratorKey, |
| 121 | IS_ARRAYscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/IS_ARRAY0:: isArrayKey, |
| 122 | OBJECTscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/OBJECT0:: node.rightscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/ForOfStatement#right., |
| 123 | INDEXscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/INDEX0:: scope.generateUidIdentifierscip-typescript npm @babel/traverse 7.20.13 src/scope/`index.ts`/Scope#generateUidIdentifier().("i"), |
| 124 | IDscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/ID0:: id, |
| 125 | INTERMEDIATEscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/INTERMEDIATE0:: intermediate, |
| 126 | }) as tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.ForStatementscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/ForStatement#; |
| 127 | |
| 128 | // |
| 129 | const isLabeledParent = tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.isLabeledStatementscip-typescript npm @babel/types 7.20.7 src/validators/generated/`index.ts`/isLabeledStatement().(parent); |
| 130 | let labeled; |
| 131 | |
| 132 | if (isLabeledParent) { |
| 133 | labeled = tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.labeledStatementscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/labeledStatement().(parent.labelscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/LabeledStatement#label., loop); |
| 134 | } |
| 135 | |
| 136 | return { |
| 137 | replaceParentscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/replaceParent0:: isLabeledParent, |
| 138 | declarscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/declar0:: declar, |
| 139 | nodescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/node0:: labeled || loop, |
| 140 | loopscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/loop0:: loop, |
| 141 | }; |
| 142 | } |
| 143 | |
| 144 | function pushComputedPropsSpecscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/pushComputedPropsSpec().( |
| 145 | pathscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/pushComputedPropsSpec().(path): NodePathscip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath#<tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.ForOfStatementscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/ForOfStatement#>, |
| 146 | statescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/pushComputedPropsSpec().(state): PluginPassscip-typescript npm @babel/core 7.20.12 src/transformation/`plugin-pass.ts`/PluginPass#, |
| 147 | ) { |
| 148 | const { nodescip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath#node., scopescip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath#scope., parentscip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath#parent. } = pathscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/pushComputedPropsSpec().(path); |
| 149 | const left = node.leftscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/ForOfStatement#left.; |
| 150 | let declar; |
| 151 | |
| 152 | const stepKey = scope.generateUidscip-typescript npm @babel/traverse 7.20.13 src/scope/`index.ts`/Scope#generateUid().("step"); |
| 153 | const stepValue = tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.memberExpressionscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/memberExpression().( |
| 154 | tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.identifierscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/identifier().(stepKey), |
| 155 | tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.identifierscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/identifier().("value"), |
| 156 | ); |
| 157 | |
| 158 | if (tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.isIdentifierscip-typescript npm @babel/types 7.20.7 src/validators/generated/`index.ts`/isIdentifier().(left) || tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.isPatternscip-typescript npm @babel/types 7.20.7 src/validators/generated/`index.ts`/isPattern().(left) || tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.isMemberExpressionscip-typescript npm @babel/types 7.20.7 src/validators/generated/`index.ts`/isMemberExpression().(left)) { |
| 159 | // for (i of test), for ({ i } of test) |
| 160 | declar = tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.expressionStatementscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/expressionStatement().( |
| 161 | tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.assignmentExpressionscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/assignmentExpression().("=", left, stepValue), |
| 162 | ); |
| 163 | } else if (tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.isVariableDeclarationscip-typescript npm @babel/types 7.20.7 src/validators/generated/`index.ts`/isVariableDeclaration().(left)) { |
| 164 | // for (let i of test) |
| 165 | declar = tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.variableDeclarationscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/variableDeclaration().(left.kindscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/VariableDeclaration#kind., [ |
| 166 | tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.variableDeclaratorscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/variableDeclarator().(left.declarationsscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/VariableDeclaration#declarations.[0].idscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/VariableDeclarator#id., stepValue), |
| 167 | ]); |
| 168 | } else { |
| 169 | throw statescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/pushComputedPropsSpec().(state).buildCodeFrameErrorscip-typescript npm @babel/core 7.20.12 src/transformation/`plugin-pass.ts`/PluginPass#buildCodeFrameError().( |
| 170 | left, |
| 171 | `Unknown node type ${left.typescip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/RestElement#type.} in ForStatement`, |
| 172 | ); |
| 173 | } |
| 174 | |
| 175 | const template = buildForOfscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/buildForOf.({ |
| 176 | ITERATOR_HAD_ERROR_KEYscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/ITERATOR_HAD_ERROR_KEY0:: scope.generateUidIdentifierscip-typescript npm @babel/traverse 7.20.13 src/scope/`index.ts`/Scope#generateUidIdentifier().("didIteratorError"), |
| 177 | ITERATOR_COMPLETIONscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/ITERATOR_COMPLETION0:: scope.generateUidIdentifierscip-typescript npm @babel/traverse 7.20.13 src/scope/`index.ts`/Scope#generateUidIdentifier().( |
| 178 | "iteratorNormalCompletion", |
| 179 | ), |
| 180 | ITERATOR_ERROR_KEYscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/ITERATOR_ERROR_KEY0:: scope.generateUidIdentifierscip-typescript npm @babel/traverse 7.20.13 src/scope/`index.ts`/Scope#generateUidIdentifier().("iteratorError"), |
| 181 | ITERATOR_KEYscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/ITERATOR_KEY0:: scope.generateUidIdentifierscip-typescript npm @babel/traverse 7.20.13 src/scope/`index.ts`/Scope#generateUidIdentifier().("iterator"), |
| 182 | STEP_KEYscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/STEP_KEY0:: tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.identifierscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/identifier().(stepKey), |
| 183 | OBJECTscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/OBJECT1:: node.rightscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/ForOfStatement#right., |
| 184 | }); |
| 185 | |
| 186 | const isLabeledParent = tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.isLabeledStatementscip-typescript npm @babel/types 7.20.7 src/validators/generated/`index.ts`/isLabeledStatement().(parent); |
| 187 | |
| 188 | const tryBody = (template[3] as tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.TryStatementscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/TryStatement#).blockscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/TryStatement#block..bodyscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/BlockStatement#body.; |
| 189 | const loop = tryBody[0] as tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.ForStatementscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/ForStatement#; |
| 190 | |
| 191 | if (isLabeledParent) { |
| 192 | tryBody[0] = tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.labeledStatementscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/labeledStatement().(parent.labelscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/LabeledStatement#label., loop); |
| 193 | } |
| 194 | |
| 195 | // |
| 196 | |
| 197 | return { |
| 198 | replaceParentscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/replaceParent1:: isLabeledParent, |
| 199 | declarscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/declar1:: declar, |
| 200 | loopscip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/loop1:: loop, |
| 201 | nodescip-typescript npm @babel/plugin-transform-for-of 7.18.8 src/`no-helper-implementation.ts`/node1:: template, |
| 202 | }; |
| 203 | } |