* 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)
| 4314 | * attributes have multiple equivalent values. |
| 4315 | */ |
| 4316 | function getValueForAttribute(node, name, expected) { |
| 4317 | { |
| 4318 | if (!isAttributeNameSafe(name)) { |
| 4319 | return; |
| 4320 | } |
| 4321 | if (!node.hasAttribute(name)) { |
| 4322 | return expected === undefined ? undefined : null; |
| 4323 | } |
| 4324 | var value = node.getAttribute(name); |
| 4325 | if (value === '' + expected) { |
| 4326 | return expected; |
| 4327 | } |
| 4328 | return value; |
| 4329 | } |
| 4330 | } |
| 4331 | |
| 4332 | /** |
| 4333 | * Sets the value for a property on a node. |
no test coverage detected