(/*String*/ format)
| 36 | }; |
| 37 | |
| 38 | var Formatter = function(/*String*/ format){ |
| 39 | this._mapped = false; |
| 40 | this._format = format; |
| 41 | this._tokens = tokenize(format, this._re, this._parseDelim, this); |
| 42 | }; |
| 43 | |
| 44 | // The old regexp `/\%(?:\(([\w_.]+)\)|([1-9]\d*)\$)?([0 +\-\#]*)(\*|\d+)?(\.)?(\*|\d+)?[hlL]?([\%bscdeEfFgGioOuxX])/` has a cubic worst-case time complexity behavior due to overlapping capture groups `([0 +\-\#]*)(\*|\d+)?(\.)?(\*|\d+)?`. And a pump string of 0 can be consumed by `([0 +\-\#]*), (\*|\d+)?, or (\*|\d+)?`. |
| 45 | // The solution replace the sub-regexp (\*|\d+)?(\.)?(\*|\d+)? with the sub-regexp `(\*|\d+)?(?:(\.)(\*|\d+)?)?`, see the figure in [#32](https://github.com/adaltas/node-printf/pull/32) |
nothing calls this directly
no test coverage detected