* @param {!RegExp} expr * @param {number} index The index in the result that's interpreted as the * major version (integer). * @return {number}
(expr, index)
| 136 | * @return {number} |
| 137 | */ |
| 138 | evalMajorVersion_(expr, index) { |
| 139 | if (!self.navigator.userAgent) { |
| 140 | return 0; |
| 141 | } |
| 142 | const res = self.navigator.userAgent.match(expr); |
| 143 | if (!res || index >= res.length) { |
| 144 | return 0; |
| 145 | } |
| 146 | return parseInt(res[index], 10); |
| 147 | }, |
| 148 | |
| 149 | /** |
| 150 | * Returns the minor ios version in string. |
nothing calls this directly
no outgoing calls
no test coverage detected