* @param {!RegExp} expr * @param {number} index The index in the result that's interpreted as the * major version (integer). * @return {number}
(expr, index)
| 154 | * @return {number} |
| 155 | */ |
| 156 | evalMajorVersion_(expr, index) { |
| 157 | if (!this.navigator_.userAgent) { |
| 158 | return 0; |
| 159 | } |
| 160 | const res = this.navigator_.userAgent.match(expr); |
| 161 | if (!res || index >= res.length) { |
| 162 | return 0; |
| 163 | } |
| 164 | return parseInt(res[index], 10); |
| 165 | } |
| 166 | |
| 167 | /** |
| 168 | * Returns the minor ios version in string. |
no outgoing calls
no test coverage detected