I took the `stringRepeat` implementation from escodegen. The bitwise operations are all about performance. Take a closer look, and you'll see it borrows a strategy from [exponentiation by squaring](http://en.wikipedia.org/wiki/Exponentiation_by_squaring), which is much faster than your naive implementation.