Use native `String.prototype.trim` in `String.prototype.trim` when available. (kangax)
This commit is contained in:
parent
6f6b73cc75
commit
cb729625ae
|
@ -407,7 +407,9 @@ Object.extend(String.prototype, (function() {
|
|||
sub: sub,
|
||||
scan: scan,
|
||||
truncate: truncate,
|
||||
strip: strip,
|
||||
// Firefox 3.5+ supports String.prototype.trim
|
||||
// (`trim` is ~ 5x faster than `strip` in FF3.5)
|
||||
strip: String.prototype.trim ? String.prototype.trim : strip,
|
||||
stripTags: stripTags,
|
||||
stripScripts: stripScripts,
|
||||
extractScripts: extractScripts,
|
||||
|
|
Loading…
Reference in New Issue