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
c2bbcd88
Commit
c2bbcd88
authored
Nov 08, 2009
by
rkatic
Committed by
John Resig
Nov 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added comments to isObject.
parent
76f6f0d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
core.js
src/core.js
+12
-1
No files found.
src/core.js
View file @
c2bbcd88
...
...
@@ -39,6 +39,7 @@ var jQuery = function( selector, context ) {
// Save a reference to some core methods
toString
=
Object
.
prototype
.
toString
,
hasOwnProperty
=
Object
.
prototype
.
hasOwnProperty
,
push
=
Array
.
prototype
.
push
,
slice
=
Array
.
prototype
.
slice
,
indexOf
=
Array
.
prototype
.
indexOf
;
...
...
@@ -323,7 +324,17 @@ jQuery.extend({
},
isObject
:
function
(
obj
)
{
return
this
.
constructor
.
call
(
obj
)
===
Object
;
if
(
toString
.
call
(
obj
)
!==
"[object Object]"
)
{
return
false
;
}
//own properties are iterated firstly,
//so to speed up, we can test last one if it is own or not
var
key
;
for
(
key
in
obj
)
{}
return
!
key
||
hasOwnProperty
.
call
(
obj
,
key
);
},
isEmptyObject
:
function
(
obj
)
{
...
...
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