src/helpers/runtime/spread-attribute.js
function spreadAttributeAST(plugin, ref, deps) {
  const { hasOwn } = deps;
  const spread = t.identifier("spread");
  const prop = t.identifier("prop");

  /**
   * function _spreadAttribute(spread) {
   *   for (var prop in spread) {
   *     if (_hasOwn.call(spread, prop)) {
   *       attr(prop, spread[prop]);
   *     }
   *   }
   * }
   */
  return t.functionExpression(
    ref,
    [spread],
    t.blockStatement([
      t.forInStatement(
        t.variableDeclaration("var", [t.variableDeclarator(prop)]),
        spread,
        t.ifStatement(
          toFunctionCall(t.memberExpression(
            hasOwn,
            t.identifier("call")
          ), [spread, prop]),
          t.expressionStatement(toFunctionCall(iDOMMethod("attr", plugin), [
            prop,
            t.memberExpression(spread, prop, true)
          ]))
        )
      )
    ])
  );
}
function spreadAttributeAST(plugin, ref, deps) {
  const { hasOwn } = deps;
  const spread = t.identifier("spread");
  const prop = t.identifier("prop");

  /**
   * function _spreadAttribute(spread) {
   *   for (var prop in spread) {
   *     if (_hasOwn.call(spread, prop)) {
   *       attr(prop, spread[prop]);
   *     }
   *   }
   * }
   */
  return t.functionExpression(
    ref,
    [spread],
    t.blockStatement([
      t.forInStatement(
        t.variableDeclaration("var", [t.variableDeclarator(prop)]),
        spread,
        t.ifStatement(
          toFunctionCall(t.memberExpression(
            hasOwn,
            t.identifier("call")
          ), [spread, prop]),
          t.expressionStatement(toFunctionCall(iDOMMethod("attr", plugin), [
            prop,
            t.memberExpression(spread, prop, true)
          ]))
        )
      )
    ])
  );
}
function spreadAttributeAST ( plugin , ref , deps ) { const { hasOwn } = deps ; const spread = t . identifier ( "spread" ) ; const prop = t . identifier ( "prop" ) ; /**
   * function _spreadAttribute(spread) {
   *   for (var prop in spread) {
   *     if (_hasOwn.call(spread, prop)) {
   *       attr(prop, spread[prop]);
   *     }
   *   }
   * }
   */ return t . functionExpression ( ref , [ spread ] , t . blockStatement ( [ t . forInStatement ( t . variableDeclaration ( "var" , [ t . variableDeclarator ( prop ) ] ) , spread , t . ifStatement ( toFunctionCall ( t . memberExpression ( hasOwn , t . identifier ( "call" ) ) , [ spread , prop ] ) , t . expressionStatement ( toFunctionCall ( iDOMMethod ( "attr" , plugin ) , [ prop , t . memberExpression ( spread , prop , true ) ] ) ) ) ) ] ) ) ; }
Iterates over a SpreadAttribute, assigning each property as an attribute on the element.
Iterates over a SpreadAttribute assigning each property as an attribute on the element .