packages/babel-plugin-proposal-object-rest-spread/src/index.js
function replaceImpureComputedKeys(path) {
    const impureComputedPropertyDeclarators = [];
    for (const propPath of path.get("properties")) {
      const key = propPath.get("key");
      if (propPath.node.computed && !key.isPure()) {
        const name = path.scope.generateUidBasedOnNode(key.node);
        const declarator = t.variableDeclarator(t.identifier(name), key.node);
        impureComputedPropertyDeclarators.push(declarator);
        key.replaceWith(t.identifier(name));
      }
    }
    return impureComputedPropertyDeclarators;
  }
function replaceImpureComputedKeys(path) {
    const impureComputedPropertyDeclarators = [];
    for (const propPath of path.get("properties")) {
      const key = propPath.get("key");
      if (propPath.node.computed && !key.isPure()) {
        const name = path.scope.generateUidBasedOnNode(key.node);
        const declarator = t.variableDeclarator(t.identifier(name), key.node);
        impureComputedPropertyDeclarators.push(declarator);
        key.replaceWith(t.identifier(name));
      }
    }
    return impureComputedPropertyDeclarators;
  }
function replaceImpureComputedKeys ( path ) { const impureComputedPropertyDeclarators = [ ] ; for ( const propPath of path . get ( "properties" ) ) { const key = propPath . get ( "key" ) ; if ( propPath . node . computed && ! key . isPure ( ) ) { const name = path . scope . generateUidBasedOnNode ( key . node ) ; const declarator = t . variableDeclarator ( t . identifier ( name ) , key . node ) ; impureComputedPropertyDeclarators . push ( declarator ) ; key . replaceWith ( t . identifier ( name ) ) ; } } return impureComputedPropertyDeclarators ; }
replaces impure computed keys with new identifiers and returns variable declarators of these new identifiers
replaces impure computed keys with new identifiers and returns variable declarators of these new identifiers