(string, end, tabSize, startIndex, startValue)
| 159 | // Counts the column offset in a string, taking tabs into account. |
| 160 | // Used mostly to find indentation. |
| 161 | function countColumn(string, end, tabSize, startIndex, startValue) { |
| 162 | if (end == null) { |
| 163 | end = string.search(/[^\s\u00a0]/); |
| 164 | if (end == -1) { end = string.length; } |
| 165 | } |
| 166 | for (var i = startIndex || 0, n = startValue || 0;;) { |
| 167 | var nextTab = string.indexOf("\t", i); |
| 168 | if (nextTab < 0 || nextTab >= end) |
| 169 | { return n + (end - i) } |
| 170 | n += nextTab - i; |
| 171 | n += tabSize - (n % tabSize); |
| 172 | i = nextTab + 1; |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | var Delayed = function() { |
| 177 | this.id = null; |
no outgoing calls
no test coverage detected