Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js

    rd565449 r0c6b92a  
    55});
    66exports.default = rewriteLiveReferences;
    7 var _assert = require("assert");
    87var _core = require("@babel/core");
    9 var _helperSimpleAccess = require("@babel/helper-simple-access");
    108function isInType(path) {
    119  do {
     
    5553  };
    5654  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   }
    6155  const rewriteReferencesVisitorState = {
    6256    seen: new WeakSet(),
     
    270264        const importData = imported.get(localName);
    271265        if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) {
    272           _assert(path.node.operator === "=", "Path was not simplified");
    273266          const assignment = path.node;
    274267          if (importData) {
     
    276269            assignment.right = _core.types.sequenceExpression([assignment.right, buildImportThrow(localName)]);
    277270          }
    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));
    279283          requeueInParent(path);
     284          path.skip();
    280285        }
    281286      } else {
     
    305310    }
    306311  },
    307   "ForOfStatement|ForInStatement"(path) {
     312  ForXStatement(path) {
    308313    const {
    309314      scope,
Note: See TracChangeset for help on using the changeset viewer.