{"diffoscope-json-version": 1, "source1": "/srv/reproducible-results/rbuild-debian/tmp.djocJxJhQ3/b1/node-babel7_7.16.6+ds1+~cs214.259.181-1_armhf.changes", "source2": "/srv/reproducible-results/rbuild-debian/tmp.djocJxJhQ3/b2/node-babel7_7.16.6+ds1+~cs214.259.181-1_armhf.changes", "unified_diff": null, "details": [{"source1": "Files", "source2": "Files", "unified_diff": "@@ -1,4 +1,4 @@\n \n 9b0468e579d8ba64b5063e4375f0a7bc 131928 javascript optional node-babel7-runtime_7.16.6+ds1+~cs214.259.181-1_all.deb\n 2d43fca01ee2f62864c87c2e5d5e6934 112480 javascript optional node-babel7-standalone_7.16.6+ds1+~cs214.259.181-1_all.deb\n- c02f18b587162e5666ca564550ee3b30 883652 javascript optional node-babel7_7.16.6+ds1+~cs214.259.181-1_all.deb\n+ c7ef0fc844aa847520f1de194793d55d 883632 javascript optional node-babel7_7.16.6+ds1+~cs214.259.181-1_all.deb\n"}, {"source1": "node-babel7_7.16.6+ds1+~cs214.259.181-1_all.deb", "source2": "node-babel7_7.16.6+ds1+~cs214.259.181-1_all.deb", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -1,3 +1,3 @@\n -rw-r--r-- 0 0 0 4 2021-12-22 05:45:58.000000 debian-binary\n--rw-r--r-- 0 0 0 37408 2021-12-22 05:45:58.000000 control.tar.xz\n--rw-r--r-- 0 0 0 846052 2021-12-22 05:45:58.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 37384 2021-12-22 05:45:58.000000 control.tar.xz\n+-rw-r--r-- 0 0 0 846056 2021-12-22 05:45:58.000000 data.tar.xz\n"}, {"source1": "control.tar.xz", "source2": "control.tar.xz", "unified_diff": null, "details": [{"source1": "control.tar", "source2": "control.tar", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "comments": ["Files differ"], "unified_diff": null}]}]}]}, {"source1": "data.tar.xz", "source2": "data.tar.xz", "unified_diff": null, "details": [{"source1": "data.tar", "source2": "data.tar", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -505,15 +505,15 @@\n drwxr-xr-x 0 root (0) root (0) 0 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-numeric-separator/\n drwxr-xr-x 0 root (0) root (0) 0 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-numeric-separator/lib/\n -rw-r--r-- 0 root (0) root (0) 784 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-numeric-separator/lib/index.js\n -rw-r--r-- 0 root (0) root (0) 1030 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-numeric-separator/package.json\n drwxr-xr-x 0 root (0) root (0) 0 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-object-rest-spread/\n drwxr-xr-x 0 root (0) root (0) 0 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-object-rest-spread/lib/\n -rw-r--r-- 0 root (0) root (0) 44564 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-object-rest-spread/lib/index.js\n--rw-r--r-- 0 root (0) root (0) 48215 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-object-rest-spread/lib/index.js.map\n+-rw-r--r-- 0 root (0) root (0) 48218 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-object-rest-spread/lib/index.js.map\n -rw-r--r-- 0 root (0) root (0) 1117 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-object-rest-spread/package.json\n drwxr-xr-x 0 root (0) root (0) 0 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-optional-catch-binding/\n drwxr-xr-x 0 root (0) root (0) 0 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-optional-catch-binding/lib/\n -rw-r--r-- 0 root (0) root (0) 748 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-optional-catch-binding/lib/index.js\n -rw-r--r-- 0 root (0) root (0) 937 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-optional-catch-binding/package.json\n drwxr-xr-x 0 root (0) root (0) 0 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-optional-chaining/\n drwxr-xr-x 0 root (0) root (0) 0 2021-12-22 05:45:58.000000 ./usr/share/nodejs/@babel/plugin-proposal-optional-chaining/lib/\n"}, {"source1": "./usr/share/nodejs/@babel/plugin-proposal-object-rest-spread/lib/index.js.map", "source2": "./usr/share/nodejs/@babel/plugin-proposal-object-rest-spread/lib/index.js.map", "unified_diff": null, "details": [{"source1": "Pretty-printed", "source2": "Pretty-printed", "comments": ["Differences: {'replace': \"OrderedDict([('version', 3), ('file', 'index.js'), ('sources', \"", " \"['../../../../../../../usr/share/nodejs/@babel/compat-data/corejs2-built-ins.js', \"", " \"'../src/shouldStoreRHSInTemporaryVariable.ts', '../src/index.ts']), \"", " \"('sourcesContent', ['module.exports = \"", " 'require(\"./data/corejs2-built-ins.json\");\\\\n\\', \\'import { types as t } from '", " '\"@babel/core\";\\\\n\\\\nconst { isObjectProperty } = t;\\\\n/**\\\\n * This is a helper '", " 'f [\u2026]"], "unified_diff": "@@ -198,15 +198,15 @@\n \"exp\",\n \"make\",\n \"hadProps\",\n \"obj\",\n \"arguments\"\n ],\n \"sources\": [\n- \"../../../../../../usr/share/nodejs/@babel/compat-data/corejs2-built-ins.js\",\n+ \"../../../../../../../usr/share/nodejs/@babel/compat-data/corejs2-built-ins.js\",\n \"../src/shouldStoreRHSInTemporaryVariable.ts\",\n \"../src/index.ts\"\n ],\n \"sourcesContent\": [\n \"module.exports = require(\\\"./data/corejs2-built-ins.json\\\");\\n\",\n \"import { types as t } from \\\"@babel/core\\\";\\n\\nconst { isObjectProperty } = t;\\n/**\\n * This is a helper function to determine if we should create an intermediate variable\\n * such that the RHS of an assignment is not duplicated.\\n *\\n * See https://github.com/babel/babel/pull/13711#issuecomment-914388382 for discussion\\n * on further optimizations.\\n */\\nexport default function shouldStoreRHSInTemporaryVariable(node: t.LVal) {\\n if (t.isArrayPattern(node)) {\\n const nonNullElements = node.elements.filter(element => element !== null);\\n if (nonNullElements.length > 1) return true;\\n else return shouldStoreRHSInTemporaryVariable(nonNullElements[0]);\\n } else if (t.isObjectPattern(node)) {\\n const { properties } = node;\\n if (properties.length > 1) return true;\\n else if (properties.length === 0) return false;\\n else {\\n const firstProperty = properties[0];\\n if (isObjectProperty(firstProperty)) {\\n // the value of the property must be an LVal\\n return shouldStoreRHSInTemporaryVariable(firstProperty.value as t.LVal);\\n } else {\\n return shouldStoreRHSInTemporaryVariable(firstProperty);\\n }\\n }\\n } else if (t.isAssignmentPattern(node)) {\\n return shouldStoreRHSInTemporaryVariable(node.left);\\n } else if (t.isRestElement(node)) {\\n if (t.isIdentifier(node.argument)) return true;\\n return shouldStoreRHSInTemporaryVariable(node.argument);\\n } else {\\n // node is Identifier or MemberExpression\\n return false;\\n }\\n}\\n\",\n \"import { declare } from \\\"@babel/helper-plugin-utils\\\";\\nimport syntaxObjectRestSpread from \\\"@babel/plugin-syntax-object-rest-spread\\\";\\nimport { types as t } from \\\"@babel/core\\\";\\nimport type { PluginPass } from \\\"@babel/core\\\";\\nimport type { NodePath, Visitor, Scope } from \\\"@babel/traverse\\\";\\nimport { convertFunctionParams } from \\\"@babel/plugin-transform-parameters\\\";\\nimport { isRequired } from \\\"@babel/helper-compilation-targets\\\";\\nimport compatData from \\\"@babel/compat-data/corejs2-built-ins\\\";\\nimport shouldStoreRHSInTemporaryVariable from \\\"./shouldStoreRHSInTemporaryVariable\\\";\\n\\nconst { isAssignmentPattern, isObjectProperty } = t;\\n// @babel/types <=7.3.3 counts FOO as referenced in var { x: FOO }.\\n// We need to detect this bug to know if \\\"unused\\\" means 0 or 1 references.\\nif (!process.env.BABEL_8_BREAKING) {\\n const node = t.identifier(\\\"a\\\");\\n const property = t.objectProperty(t.identifier(\\\"key\\\"), node);\\n const pattern = t.objectPattern([property]);\\n\\n // eslint-disable-next-line no-var\\n var ZERO_REFS = t.isReferenced(node, property, pattern) ? 1 : 0;\\n}\\n\\nexport default declare((api, opts) => {\\n api.assertVersion(7);\\n\\n const targets = api.targets();\\n const supportsObjectAssign = !isRequired(\\\"es6.object.assign\\\", targets, {\\n compatData,\\n });\\n\\n const { useBuiltIns = supportsObjectAssign, loose = false } = opts;\\n\\n if (typeof loose !== \\\"boolean\\\") {\\n throw new Error(\\\".loose must be a boolean, or undefined\\\");\\n }\\n\\n const ignoreFunctionLength = api.assumption(\\\"ignoreFunctionLength\\\") ?? loose;\\n const objectRestNoSymbols = api.assumption(\\\"objectRestNoSymbols\\\") ?? loose;\\n const pureGetters = api.assumption(\\\"pureGetters\\\") ?? loose;\\n const setSpreadProperties = api.assumption(\\\"setSpreadProperties\\\") ?? loose;\\n\\n function getExtendsHelper(\\n file: PluginPass,\\n ): t.MemberExpression | t.Identifier {\\n return useBuiltIns\\n ? t.memberExpression(t.identifier(\\\"Object\\\"), t.identifier(\\\"assign\\\"))\\n : file.addHelper(\\\"extends\\\");\\n }\\n\\n function hasRestElement(path) {\\n let foundRestElement = false;\\n visitRestElements(path, restElement => {\\n foundRestElement = true;\\n restElement.stop();\\n });\\n return foundRestElement;\\n }\\n\\n function hasObjectPatternRestElement(path: NodePath): boolean {\\n let foundRestElement = false;\\n visitRestElements(path, restElement => {\\n if (restElement.parentPath.isObjectPattern()) {\\n foundRestElement = true;\\n restElement.stop();\\n }\\n });\\n return foundRestElement;\\n }\\n\\n function visitRestElements(\\n path: NodePath,\\n visitor: (path: NodePath) => any,\\n ) {\\n path.traverse({\\n Expression(path) {\\n const { parent, key } = path;\\n if (\\n (isAssignmentPattern(parent) && key === \\\"right\\\") ||\\n (isObjectProperty(parent) && parent.computed && key === \\\"key\\\")\\n ) {\\n path.skip();\\n }\\n },\\n RestElement: visitor,\\n });\\n }\\n\\n function hasSpread(node: t.ObjectExpression): boolean {\\n for (const prop of node.properties) {\\n if (t.isSpreadElement(prop)) {\\n return true;\\n }\\n }\\n return false;\\n }\\n\\n // returns an array of all keys of an object, and a status flag indicating if all extracted keys\\n // were converted to stringLiterals or not\\n // e.g. extracts {keys: [\\\"a\\\", \\\"b\\\", \\\"3\\\", ++x], allLiteral: false }\\n // from ast of {a: \\\"foo\\\", b, 3: \\\"bar\\\", [++x]: \\\"baz\\\"}\\n function extractNormalizedKeys(node: t.ObjectPattern) {\\n // RestElement has been removed in createObjectRest\\n const props = node.properties as t.ObjectProperty[];\\n const keys: t.Expression[] = [];\\n let allLiteral = true;\\n let hasTemplateLiteral = false;\\n\\n for (const prop of props) {\\n if (t.isIdentifier(prop.key) && !prop.computed) {\\n // since a key {a: 3} is equivalent to {\\\"a\\\": 3}, use the latter\\n keys.push(t.stringLiteral(prop.key.name));\\n } else if (t.isTemplateLiteral(prop.key)) {\\n keys.push(t.cloneNode(prop.key));\\n hasTemplateLiteral = true;\\n } else if (t.isLiteral(prop.key)) {\\n keys.push(\\n t.stringLiteral(\\n String(\\n //@ts-ignore prop.key can not be a NullLiteral\\n prop.key.value,\\n ),\\n ),\\n );\\n } else {\\n keys.push(t.cloneNode(prop.key));\\n allLiteral = false;\\n }\\n }\\n\\n return { keys, allLiteral, hasTemplateLiteral };\\n }\\n\\n // replaces impure computed keys with new identifiers\\n // and returns variable declarators of these new identifiers\\n function replaceImpureComputedKeys(\\n properties: NodePath[],\\n scope: Scope,\\n ) {\\n const impureComputedPropertyDeclarators: t.VariableDeclarator[] = [];\\n for (const propPath of properties) {\\n const key = propPath.get(\\\"key\\\");\\n if (propPath.node.computed && !key.isPure()) {\\n// @ts-ignore\\n const name = scope.generateUidBasedOnNode(key.node);\\n// @ts-ignore\\n const declarator = t.variableDeclarator(t.identifier(name), key.node);\\n impureComputedPropertyDeclarators.push(declarator);\\n// @ts-ignore\\n key.replaceWith(t.identifier(name));\\n }\\n }\\n return impureComputedPropertyDeclarators;\\n }\\n\\n function removeUnusedExcludedKeys(path: NodePath): void {\\n const bindings = path.getOuterBindingIdentifierPaths();\\n\\n Object.keys(bindings).forEach(bindingName => {\\n const bindingParentPath = bindings[bindingName].parentPath;\\n if (\\n path.scope.getBinding(bindingName).references >\\n (process.env.BABEL_8_BREAKING ? 0 : ZERO_REFS) ||\\n !bindingParentPath.isObjectProperty()\\n ) {\\n return;\\n }\\n bindingParentPath.remove();\\n });\\n }\\n\\n //expects path to an object pattern\\n function createObjectRest(\\n path: NodePath,\\n file: PluginPass,\\n objRef: t.Identifier | t.MemberExpression,\\n ): [t.VariableDeclarator[], t.LVal, t.CallExpression] {\\n const props = path.get(\\\"properties\\\");\\n const last = props[props.length - 1];\\n t.assertRestElement(last.node);\\n const restElement = t.cloneNode(last.node);\\n last.remove();\\n\\n const impureComputedPropertyDeclarators = replaceImpureComputedKeys(\\n path.get(\\\"properties\\\") as NodePath[],\\n path.scope,\\n );\\n const { keys, allLiteral, hasTemplateLiteral } = extractNormalizedKeys(\\n path.node,\\n );\\n\\n if (keys.length === 0) {\\n return [\\n impureComputedPropertyDeclarators,\\n restElement.argument,\\n t.callExpression(getExtendsHelper(file), [\\n t.objectExpression([]),\\n t.cloneNode(objRef),\\n ]),\\n ];\\n }\\n\\n let keyExpression;\\n if (!allLiteral) {\\n // map to toPropertyKey to handle the possible non-string values\\n keyExpression = t.callExpression(\\n t.memberExpression(t.arrayExpression(keys), t.identifier(\\\"map\\\")),\\n [file.addHelper(\\\"toPropertyKey\\\")],\\n );\\n } else {\\n keyExpression = t.arrayExpression(keys);\\n\\n if (!hasTemplateLiteral && !t.isProgram(path.scope.block)) {\\n // Hoist definition of excluded keys, so that it's not created each time.\\n const program = path.findParent(path => path.isProgram());\\n const id = path.scope.generateUidIdentifier(\\\"excluded\\\");\\n\\n program.scope.push({\\n id,\\n init: keyExpression,\\n kind: \\\"const\\\",\\n });\\n\\n keyExpression = t.cloneNode(id);\\n }\\n }\\n\\n return [\\n impureComputedPropertyDeclarators,\\n restElement.argument,\\n t.callExpression(\\n file.addHelper(\\n `objectWithoutProperties${objectRestNoSymbols ? \\\"Loose\\\" : \\\"\\\"}`,\\n ),\\n [t.cloneNode(objRef), keyExpression],\\n ),\\n ];\\n }\\n\\n function replaceRestElement(\\n parentPath: NodePath,\\n paramPath: NodePath,\\n container?: t.VariableDeclaration[],\\n ): void {\\n if (paramPath.isAssignmentPattern()) {\\n replaceRestElement(parentPath, paramPath.get(\\\"left\\\"), container);\\n return;\\n }\\n\\n if (paramPath.isArrayPattern() && hasRestElement(paramPath)) {\\n const elements = paramPath.get(\\\"elements\\\");\\n\\n for (let i = 0; i < elements.length; i++) {\\n replaceRestElement(parentPath, elements[i], container);\\n }\\n }\\n\\n if (paramPath.isObjectPattern() && hasRestElement(paramPath)) {\\n const uid = parentPath.scope.generateUidIdentifier(\\\"ref\\\");\\n\\n const declar = t.variableDeclaration(\\\"let\\\", [\\n t.variableDeclarator(paramPath.node, uid),\\n ]);\\n\\n if (container) {\\n container.push(declar);\\n } else {\\n parentPath.ensureBlock();\\n parentPath.get(\\\"body\\\").unshiftContainer(\\\"body\\\", declar);\\n }\\n paramPath.replaceWith(t.cloneNode(uid));\\n }\\n }\\n\\n return {\\n name: \\\"proposal-object-rest-spread\\\",\\n inherits: syntaxObjectRestSpread.default,\\n\\n visitor: {\\n // function a({ b, ...c }) {}\\n Function(path) {\\n const params = path.get(\\\"params\\\");\\n const paramsWithRestElement = new Set();\\n const idsInRestParams = new Set();\\n for (let i = 0; i < params.length; ++i) {\\n const param = params[i];\\n if (hasRestElement(param)) {\\n paramsWithRestElement.add(i);\\n for (const name of Object.keys(param.getBindingIdentifiers())) {\\n idsInRestParams.add(name);\\n }\\n }\\n }\\n\\n // if true, a parameter exists that has an id in its initializer\\n // that is also an id bound in a rest parameter\\n // example: f({...R}, a = R)\\n let idInRest = false;\\n\\n const IdentifierHandler = function (path, functionScope) {\\n const name = path.node.name;\\n if (\\n path.scope.getBinding(name) === functionScope.getBinding(name) &&\\n idsInRestParams.has(name)\\n ) {\\n idInRest = true;\\n path.stop();\\n }\\n };\\n\\n let i;\\n for (i = 0; i < params.length && !idInRest; ++i) {\\n const param = params[i];\\n if (!paramsWithRestElement.has(i)) {\\n// @ts-ignore\\n if (param.isReferencedIdentifier() || param.isBindingIdentifier()) {\\n IdentifierHandler(path, path.scope);\\n } else {\\n// @ts-ignore\\n param.traverse(\\n {\\n \\\"Scope|TypeAnnotation|TSTypeAnnotation\\\": path => path.skip(),\\n \\\"ReferencedIdentifier|BindingIdentifier\\\": IdentifierHandler,\\n },\\n path.scope,\\n );\\n }\\n }\\n }\\n\\n if (!idInRest) {\\n for (let i = 0; i < params.length; ++i) {\\n const param = params[i];\\n if (paramsWithRestElement.has(i)) {\\n replaceRestElement(path, param);\\n }\\n }\\n } else {\\n const shouldTransformParam = idx =>\\n idx >= i - 1 || paramsWithRestElement.has(idx);\\n convertFunctionParams(\\n path,\\n ignoreFunctionLength,\\n shouldTransformParam,\\n replaceRestElement,\\n );\\n }\\n },\\n\\n // adapted from transform-destructuring/src/index.js#pushObjectRest\\n // const { a, ...b } = c;\\n VariableDeclarator(path, file) {\\n if (!path.get(\\\"id\\\").isObjectPattern()) {\\n return;\\n }\\n\\n let insertionPath = path;\\n const originalPath = path;\\n\\n visitRestElements(path.get(\\\"id\\\"), path => {\\n if (!path.parentPath.isObjectPattern()) {\\n // Return early if the parent is not an ObjectPattern, but\\n // (for example) an ArrayPattern or Function, because that\\n // means this RestElement is an not an object property.\\n return;\\n }\\n\\n if (\\n // skip single-property case, e.g.\\n // const { ...x } = foo();\\n // since the RHS will not be duplicated\\n shouldStoreRHSInTemporaryVariable(originalPath.node.id) &&\\n !t.isIdentifier(originalPath.node.init)\\n ) {\\n // const { a, ...b } = foo();\\n // to avoid calling foo() twice, as a first step convert it to:\\n // const _foo = foo(),\\n // { a, ...b } = _foo;\\n const initRef = path.scope.generateUidIdentifierBasedOnNode(\\n originalPath.node.init,\\n \\\"ref\\\",\\n );\\n // insert _foo = foo()\\n originalPath.insertBefore(\\n t.variableDeclarator(initRef, originalPath.node.init),\\n );\\n // replace foo() with _foo\\n originalPath.replaceWith(\\n t.variableDeclarator(originalPath.node.id, t.cloneNode(initRef)),\\n );\\n\\n return;\\n }\\n\\n let ref = originalPath.node.init;\\n const refPropertyPath: NodePath[] = [];\\n let kind;\\n\\n path.findParent((path: NodePath): boolean => {\\n if (path.isObjectProperty()) {\\n refPropertyPath.unshift(path);\\n } else if (path.isVariableDeclarator()) {\\n kind = (path.parentPath as NodePath).node\\n .kind;\\n return true;\\n }\\n });\\n\\n const impureObjRefComputedDeclarators = replaceImpureComputedKeys(\\n refPropertyPath,\\n path.scope,\\n );\\n refPropertyPath.forEach(prop => {\\n const { node } = prop;\\n ref = t.memberExpression(\\n ref,\\n t.cloneNode(node.key),\\n node.computed || t.isLiteral(node.key),\\n );\\n });\\n\\n //@ts-expect-error: findParent can not apply assertions on result shape\\n const objectPatternPath: NodePath = path.findParent(\\n path => path.isObjectPattern(),\\n );\\n\\n const [impureComputedPropertyDeclarators, argument, callExpression] =\\n createObjectRest(\\n objectPatternPath,\\n file,\\n ref as t.MemberExpression,\\n );\\n\\n if (pureGetters) {\\n removeUnusedExcludedKeys(objectPatternPath);\\n }\\n\\n t.assertIdentifier(argument);\\n\\n insertionPath.insertBefore(impureComputedPropertyDeclarators);\\n\\n insertionPath.insertBefore(impureObjRefComputedDeclarators);\\n\\n insertionPath = insertionPath.insertAfter(\\n t.variableDeclarator(argument, callExpression),\\n )[0] as NodePath;\\n\\n path.scope.registerBinding(kind, insertionPath);\\n\\n if (objectPatternPath.node.properties.length === 0) {\\n objectPatternPath\\n .findParent(\\n path => path.isObjectProperty() || path.isVariableDeclarator(),\\n )\\n .remove();\\n }\\n });\\n },\\n\\n // taken from transform-destructuring/src/index.js#visitor\\n // export var { a, ...b } = c;\\n ExportNamedDeclaration(path) {\\n const declaration = path.get(\\\"declaration\\\");\\n if (!declaration.isVariableDeclaration()) return;\\n\\n const hasRest = declaration\\n .get(\\\"declarations\\\")\\n .some(path => hasObjectPatternRestElement(path.get(\\\"id\\\")));\\n if (!hasRest) return;\\n\\n const specifiers = [];\\n\\n for (const name of Object.keys(path.getOuterBindingIdentifiers(true))) {\\n specifiers.push(\\n t.exportSpecifier(t.identifier(name), t.identifier(name)),\\n );\\n }\\n\\n // Split the declaration and export list into two declarations so that the variable\\n // declaration can be split up later without needing to worry about not being a\\n // top-level statement.\\n path.replaceWith(declaration.node);\\n path.insertAfter(t.exportNamedDeclaration(null, specifiers));\\n },\\n\\n // try {} catch ({a, ...b}) {}\\n CatchClause(path) {\\n const paramPath = path.get(\\\"param\\\");\\n replaceRestElement(path, paramPath);\\n },\\n\\n // ({a, ...b} = c);\\n AssignmentExpression(path, file) {\\n const leftPath = path.get(\\\"left\\\");\\n if (leftPath.isObjectPattern() && hasRestElement(leftPath)) {\\n const nodes = [];\\n\\n const refName = path.scope.generateUidBasedOnNode(\\n path.node.right,\\n \\\"ref\\\",\\n );\\n\\n nodes.push(\\n t.variableDeclaration(\\\"var\\\", [\\n t.variableDeclarator(t.identifier(refName), path.node.right),\\n ]),\\n );\\n\\n const [impureComputedPropertyDeclarators, argument, callExpression] =\\n createObjectRest(leftPath, file, t.identifier(refName));\\n\\n if (impureComputedPropertyDeclarators.length > 0) {\\n nodes.push(\\n t.variableDeclaration(\\\"var\\\", impureComputedPropertyDeclarators),\\n );\\n }\\n\\n const nodeWithoutSpread = t.cloneNode(path.node);\\n nodeWithoutSpread.right = t.identifier(refName);\\n nodes.push(t.expressionStatement(nodeWithoutSpread));\\n nodes.push(\\n t.toStatement(\\n t.assignmentExpression(\\\"=\\\", argument, callExpression),\\n ),\\n );\\n nodes.push(t.expressionStatement(t.identifier(refName)));\\n\\n path.replaceWithMultiple(nodes);\\n }\\n },\\n\\n // taken from transform-destructuring/src/index.js#visitor\\n ForXStatement(path) {\\n const { node, scope } = path;\\n const leftPath = path.get(\\\"left\\\");\\n const left = node.left;\\n\\n if (!hasObjectPatternRestElement(leftPath)) {\\n return;\\n }\\n\\n if (!t.isVariableDeclaration(left)) {\\n // for ({a, ...b} of []) {}\\n const temp = scope.generateUidIdentifier(\\\"ref\\\");\\n\\n node.left = t.variableDeclaration(\\\"var\\\", [\\n t.variableDeclarator(temp),\\n ]);\\n\\n path.ensureBlock();\\n const body = node.body as t.BlockStatement;\\n\\n if (body.body.length === 0 && path.isCompletionRecord()) {\\n body.body.unshift(\\n t.expressionStatement(scope.buildUndefinedNode()),\\n );\\n }\\n\\n body.body.unshift(\\n t.expressionStatement(\\n t.assignmentExpression(\\\"=\\\", left, t.cloneNode(temp)),\\n ),\\n );\\n } else {\\n // for (var {a, ...b} of []) {}\\n const pattern = left.declarations[0].id;\\n\\n const key = scope.generateUidIdentifier(\\\"ref\\\");\\n node.left = t.variableDeclaration(left.kind, [\\n t.variableDeclarator(key, null),\\n ]);\\n\\n path.ensureBlock();\\n const body = node.body as t.BlockStatement;\\n\\n body.body.unshift(\\n t.variableDeclaration(node.left.kind, [\\n t.variableDeclarator(pattern, t.cloneNode(key)),\\n ]),\\n );\\n }\\n },\\n\\n // [{a, ...b}] = c;\\n ArrayPattern(path) {\\n const objectPatterns = [];\\n\\n visitRestElements(path, path => {\\n if (!path.parentPath.isObjectPattern()) {\\n // Return early if the parent is not an ObjectPattern, but\\n // (for example) an ArrayPattern or Function, because that\\n // means this RestElement is an not an object property.\\n return;\\n }\\n\\n const objectPattern = path.parentPath;\\n\\n const uid = path.scope.generateUidIdentifier(\\\"ref\\\");\\n objectPatterns.push(t.variableDeclarator(objectPattern.node, uid));\\n\\n objectPattern.replaceWith(t.cloneNode(uid));\\n path.skip();\\n });\\n\\n if (objectPatterns.length > 0) {\\n const statementPath = path.getStatementParent();\\n const statementNode = statementPath.node;\\n const kind =\\n statementNode.type === \\\"VariableDeclaration\\\"\\n ? statementNode.kind\\n : \\\"var\\\";\\n statementPath.insertAfter(\\n t.variableDeclaration(kind, objectPatterns),\\n );\\n }\\n },\\n\\n // var a = { ...b, ...c }\\n ObjectExpression(path, file) {\\n if (!hasSpread(path.node)) return;\\n\\n let helper;\\n if (setSpreadProperties) {\\n helper = getExtendsHelper(file);\\n } else {\\n try {\\n helper = file.addHelper(\\\"objectSpread2\\\");\\n } catch {\\n // TODO: This is needed to workaround https://github.com/babel/babel/issues/10187\\n // and https://github.com/babel/babel/issues/10179 for older @babel/core versions\\n // where #10187 isn't fixed.\\n this.file.declarations[\\\"objectSpread2\\\"] = null;\\n\\n // objectSpread2 has been introduced in v7.5.0\\n // We have to maintain backward compatibility.\\n helper = file.addHelper(\\\"objectSpread\\\");\\n }\\n }\\n\\n let exp = null;\\n let props = [];\\n\\n function make() {\\n const hadProps = props.length > 0;\\n const obj = t.objectExpression(props);\\n props = [];\\n\\n if (!exp) {\\n exp = t.callExpression(helper, [obj]);\\n return;\\n }\\n\\n // When we can assume that getters are pure and don't depend on\\n // the order of evaluation, we can avoid making multiple calls.\\n if (pureGetters) {\\n if (hadProps) {\\n exp.arguments.push(obj);\\n }\\n return;\\n }\\n\\n exp = t.callExpression(t.cloneNode(helper), [\\n exp,\\n // If we have static props, we need to insert an empty object\\n // because the odd arguments are copied with [[Get]], not\\n // [[GetOwnProperty]]\\n ...(hadProps ? [t.objectExpression([]), obj] : []),\\n ]);\\n }\\n\\n for (const prop of path.node.properties) {\\n if (t.isSpreadElement(prop)) {\\n make();\\n exp.arguments.push(prop.argument);\\n } else {\\n props.push(prop);\\n }\\n }\\n\\n if (props.length) make();\\n\\n path.replaceWith(exp);\\n },\\n } as Visitor,\\n };\\n});\\n\"\n"}]}]}]}]}]}