Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
ba8938d4
Commit
ba8938d4
authored
Mar 11, 2010
by
jeresig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to using String.prototype.trim from String.trim as it's more-widely available.
parent
da26d0eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
core.js
src/core.js
+3
-2
No files found.
src/core.js
View file @
ba8938d4
...
@@ -53,6 +53,7 @@ var jQuery = function( selector, context ) {
...
@@ -53,6 +53,7 @@ var jQuery = function( selector, context ) {
hasOwn
=
Object
.
prototype
.
hasOwnProperty
,
hasOwn
=
Object
.
prototype
.
hasOwnProperty
,
push
=
Array
.
prototype
.
push
,
push
=
Array
.
prototype
.
push
,
slice
=
Array
.
prototype
.
slice
,
slice
=
Array
.
prototype
.
slice
,
trim
=
String
.
prototype
.
trim
,
indexOf
=
Array
.
prototype
.
indexOf
;
indexOf
=
Array
.
prototype
.
indexOf
;
jQuery
.
fn
=
jQuery
.
prototype
=
{
jQuery
.
fn
=
jQuery
.
prototype
=
{
...
@@ -569,11 +570,11 @@ jQuery.extend({
...
@@ -569,11 +570,11 @@ jQuery.extend({
},
},
// Use native String.trim function wherever possible
// Use native String.trim function wherever possible
trim
:
String
.
trim
?
trim
:
trim
?
function
(
text
)
{
function
(
text
)
{
return
text
==
null
?
return
text
==
null
?
""
:
""
:
String
.
trim
(
text
);
trim
.
call
(
text
);
}
:
}
:
// Otherwise use our own trimming functionality
// Otherwise use our own trimming functionality
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment