* Get the value for a attribute on a node. Only used in DEV for SSR validation. * The third argument is used as a hint of what the expected value is. Some * attributes have multiple equivalent values.
(node, name, expected, isCustomComponentTag)
| 729 | */ |
| 730 | |
| 731 | function getValueForAttribute(node, name, expected, isCustomComponentTag) { |
| 732 | { |
| 733 | if (!isAttributeNameSafe(name)) { |
| 734 | return; |
| 735 | } |
| 736 | |
| 737 | if (!node.hasAttribute(name)) { |
| 738 | return expected === undefined ? undefined : null; |
| 739 | } |
| 740 | |
| 741 | var value = node.getAttribute(name); |
| 742 | |
| 743 | { |
| 744 | checkAttributeStringCoercion(expected, name); |
| 745 | } |
| 746 | |
| 747 | if (value === '' + expected) { |
| 748 | return expected; |
| 749 | } |
| 750 | |
| 751 | return value; |
| 752 | } |
| 753 | } |
| 754 | /** |
| 755 | * Sets the value for a property on a node. |
| 756 | * |
no test coverage detected
searching dependent graphs…