jakiestfu / Behave.js

A lightweight, cross browser library for adding IDE style behaviors to plain text areas
http://jakiestfu.github.com/Behave.js/
1.74k stars 110 forks source link

Use native String#repeat if available. #2

Closed paulmillr closed 11 years ago

paulmillr commented 11 years ago

Also, MUCH faster algorithm otherwise.

String.prototype.repeat made it through to new ECMAScript standard, so it will be bad to overwrite existing methods.

Taken from my es6-shim (https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js).