Bug Tracker

Ticket #2279: jquery-4763-trim.diff

File jquery-4763-trim.diff, 457 bytes (added by DarkRyder, 4 years ago)

Diff against rev 2763.

  • core.js

     
    11141114        }, 
    11151115         
    11161116        trim: function( text ) { 
    1117                 return (text || "").replace( /^\s+|\s+$/g, "" ); 
     1117                var text = (text || "").replace(/^\s\s*/, ''), 
     1118                    ws = /\s/, 
     1119                    i = text.length; 
     1120                while ( ws.test(text.charAt(--i)) ); 
     1121                return text.slice(0, i + 1); 
    11181122        }, 
    11191123 
    11201124        makeArray: function( array ) {