MCPcopy Create free account
hub / github.com/reactjs/react-rails / visitStructuredAssignment

Function visitStructuredAssignment

lib/assets/javascripts/JSXTransformer.js:14287–14303  ·  view source on GitHub ↗
(traverse, node, path, state)

Source from the content-addressed store, hash-verified

14285// -------------------------------------------------------
14286
14287function visitStructuredAssignment(traverse, node, path, state) {
14288 var exprNode = node.expression;
14289 utils.append('var ' + utils.getTempVar(state.localScope.tempVarIndex) + '=', state);
14290
14291 utils.catchupWhiteSpace(exprNode.right.range[0], state);
14292 traverse(exprNode.right, path, state);
14293 utils.catchup(exprNode.right.range[1], state);
14294
14295 utils.append(
14296 ';' + getDestructuredComponents(exprNode.left, state) + ';',
14297 state
14298 );
14299
14300 utils.catchupWhiteSpace(node.range[1], state);
14301 state.localScope.tempVarIndex++;
14302 return false;
14303}
14304
14305visitStructuredAssignment.test = function(node, path, state) {
14306 // We consider the expression statement rather than just assignment

Callers

nothing calls this directly

Calls 2

traverseFunction · 0.85

Tested by

no test coverage detected