* Scans the element for bindings and adds up to |quota| to `outBindings`. * Also updates ivars `boundElements_` and `expressionToElements_`. * @param {!Element} element * @param {number} quota * @param {!Array<!BindBindingDef>} outBindings * @return {boolean} Returns true if `element`
(element, quota, outBindings)
| 936 | * bindings. Otherwise, returns false. |
| 937 | */ |
| 938 | scanElement_(element, quota, outBindings) { |
| 939 | let quotaExceeded = false; |
| 940 | const boundProperties = this.boundPropertiesInElement_(element); |
| 941 | if (boundProperties.length > quota) { |
| 942 | boundProperties.length = quota; |
| 943 | quotaExceeded = true; |
| 944 | } |
| 945 | if (boundProperties.length > 0) { |
| 946 | this.boundElements_.push({element, boundProperties}); |
| 947 | } |
| 948 | const {tagName} = element; |
| 949 | boundProperties.forEach((boundProperty) => { |
| 950 | const {expressionString, property} = boundProperty; |
| 951 | outBindings.push({tagName, property, expressionString}); |
| 952 | if (!this.expressionToElements_[expressionString]) { |
| 953 | this.expressionToElements_[expressionString] = []; |
| 954 | } |
| 955 | this.expressionToElements_[expressionString].push(element); |
| 956 | }); |
| 957 | return quotaExceeded; |
| 958 | } |
| 959 | |
| 960 | /** |
| 961 | * Returns bound properties for an element. |
no test coverage detected