Skip to content

Commit ba8938d

Browse files
committed
Switch to using String.prototype.trim from String.trim as it's more-widely available.
1 parent da26d0e commit ba8938d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ var jQuery = function( selector, context ) {
5353
hasOwn = Object.prototype.hasOwnProperty,
5454
push = Array.prototype.push,
5555
slice = Array.prototype.slice,
56+
trim = String.prototype.trim,
5657
indexOf = Array.prototype.indexOf;
5758

5859
jQuery.fn = jQuery.prototype = {
@@ -569,11 +570,11 @@ jQuery.extend({
569570
},
570571

571572
// Use native String.trim function wherever possible
572-
trim: String.trim ?
573+
trim: trim ?
573574
function( text ) {
574575
return text == null ?
575576
"" :
576-
String.trim( text );
577+
trim.call( text );
577578
} :
578579

579580
// Otherwise use our own trimming functionality

0 commit comments

Comments
 (0)