protected final function spreadElementImpl()

in src/core/Node.hack [377:397]


  protected final function spreadElementImpl(node $element): void {
    $attrs = $element::__xhpReflectionAttributes()
      |> Dict\filter($$, $attr ==> $attr->hasDefaultValue())
      |> Dict\map($$, $attr ==> $attr->getDefaultValue())
      |> Dict\merge($$, $element->getAttributes());
    foreach ($attrs as $attr_name => $value) {
      if (
        $value === null ||
        !(
          ReflectionXHPAttribute::isSpecial($attr_name) ||
          (static::__xhpReflectionAttribute($attr_name) !== null)
        )
      ) {
        continue;
      }

      // If the receiving class has the same attribute and we had a value or
      // a default, then copy it over.
      $this->setAttribute($attr_name, $value);
    }
  }