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
ad16db37
Commit
ad16db37
authored
Jul 25, 2011
by
Rick Waldron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap obj.constructor test in try/catch. Thanks to bkrausz. Fixes #9897
parent
27291ff0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
core.js
src/core.js
+9
-4
core.js
test/unit/core.js
+8
-1
No files found.
src/core.js
View file @
ad16db37
...
@@ -500,10 +500,15 @@ jQuery.extend({
...
@@ -500,10 +500,15 @@ jQuery.extend({
return
false
;
return
false
;
}
}
// Not own constructor property must be Object
try
{
if
(
obj
.
constructor
&&
// Not own constructor property must be Object
!
hasOwn
.
call
(
obj
,
"constructor"
)
&&
if
(
obj
.
constructor
&&
!
hasOwn
.
call
(
obj
.
constructor
.
prototype
,
"isPrototypeOf"
)
)
{
!
hasOwn
.
call
(
obj
,
"constructor"
)
&&
!
hasOwn
.
call
(
obj
.
constructor
.
prototype
,
"isPrototypeOf"
)
)
{
return
false
;
}
}
catch
(
e
)
{
// IE8,9 Will throw exceptions on certain host objects #9897
return
false
;
return
false
;
}
}
...
...
test/unit/core.js
View file @
ad16db37
...
@@ -290,7 +290,7 @@ test("type", function() {
...
@@ -290,7 +290,7 @@ test("type", function() {
});
});
test
(
"isPlainObject"
,
function
()
{
test
(
"isPlainObject"
,
function
()
{
expect
(
1
4
);
expect
(
1
5
);
stop
();
stop
();
...
@@ -331,6 +331,13 @@ test("isPlainObject", function() {
...
@@ -331,6 +331,13 @@ test("isPlainObject", function() {
// Window
// Window
ok
(
!
jQuery
.
isPlainObject
(
window
),
"window"
);
ok
(
!
jQuery
.
isPlainObject
(
window
),
"window"
);
try
{
jQuery
.
isPlainObject
(
window
.
location
);
ok
(
true
,
"Does not throw exceptions on host objects"
);
}
catch
(
e
)
{
ok
(
false
,
"Does not throw exceptions on host objects -- FAIL"
);
}
try
{
try
{
var
iframe
=
document
.
createElement
(
"iframe"
);
var
iframe
=
document
.
createElement
(
"iframe"
);
document
.
body
.
appendChild
(
iframe
);
document
.
body
.
appendChild
(
iframe
);
...
...
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