Changeset 0c6b92a for imaps-frontend/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js
rd565449 r0c6b92a 5 5 }); 6 6 exports.default = rewriteLiveReferences; 7 var _assert = require("assert");8 7 var _core = require("@babel/core"); 9 var _helperSimpleAccess = require("@babel/helper-simple-access");10 8 function isInType(path) { 11 9 do { … … 55 53 }; 56 54 programPath.traverse(rewriteBindingInitVisitor, rewriteBindingInitVisitorState); 57 const bindingNames = new Set([...Array.from(imported.keys()), ...Array.from(exported.keys())]);58 {59 (0, _helperSimpleAccess.default)(programPath, bindingNames, false);60 }61 55 const rewriteReferencesVisitorState = { 62 56 seen: new WeakSet(), … … 270 264 const importData = imported.get(localName); 271 265 if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) { 272 _assert(path.node.operator === "=", "Path was not simplified");273 266 const assignment = path.node; 274 267 if (importData) { … … 276 269 assignment.right = _core.types.sequenceExpression([assignment.right, buildImportThrow(localName)]); 277 270 } 278 path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, assignment, path.scope)); 271 const { 272 operator 273 } = assignment; 274 let newExpr; 275 if (operator === "=") { 276 newExpr = assignment; 277 } else if (operator === "&&=" || operator === "||=" || operator === "??=") { 278 newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.logicalExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right)); 279 } else { 280 newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.binaryExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right)); 281 } 282 path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, newExpr, path.scope)); 279 283 requeueInParent(path); 284 path.skip(); 280 285 } 281 286 } else { … … 305 310 } 306 311 }, 307 "ForOfStatement|ForInStatement"(path) {312 ForXStatement(path) { 308 313 const { 309 314 scope,
Note:
See TracChangeset
for help on using the changeset viewer.