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
a6ef036b
Commit
a6ef036b
authored
Jan 23, 2010
by
jeresig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Centralize the logic for throwing exceptions. Fixes #5913.
parent
3e286440
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
ajax.js
src/ajax.js
+2
-2
attributes.js
src/attributes.js
+1
-1
core.js
src/core.js
+4
-0
No files found.
src/ajax.js
View file @
a6ef036b
...
@@ -578,7 +578,7 @@ jQuery.extend({
...
@@ -578,7 +578,7 @@ jQuery.extend({
data
=
xml
?
xhr
.
responseXML
:
xhr
.
responseText
;
data
=
xml
?
xhr
.
responseXML
:
xhr
.
responseText
;
if
(
xml
&&
data
.
documentElement
.
nodeName
===
"parsererror"
)
{
if
(
xml
&&
data
.
documentElement
.
nodeName
===
"parsererror"
)
{
throw
"parsererror"
;
jQuery
.
error
(
"parsererror"
)
;
}
}
// Allow a pre-filtering function to sanitize the response
// Allow a pre-filtering function to sanitize the response
...
@@ -606,7 +606,7 @@ jQuery.extend({
...
@@ -606,7 +606,7 @@ jQuery.extend({
}
}
}
else
{
}
else
{
throw
"Invalid JSON: "
+
data
;
jQuery
.
error
(
"Invalid JSON: "
+
data
)
;
}
}
// If the type is "script", eval it in global context
// If the type is "script", eval it in global context
...
...
src/attributes.js
View file @
a6ef036b
...
@@ -281,7 +281,7 @@ jQuery.extend({
...
@@ -281,7 +281,7 @@ jQuery.extend({
if
(
set
)
{
if
(
set
)
{
// We can't allow the type property to be changed (since it causes problems in IE)
// We can't allow the type property to be changed (since it causes problems in IE)
if
(
name
===
"type"
&&
rtype
.
test
(
elem
.
nodeName
)
&&
elem
.
parentNode
)
{
if
(
name
===
"type"
&&
rtype
.
test
(
elem
.
nodeName
)
&&
elem
.
parentNode
)
{
throw
"type property can't be changed"
;
jQuery
.
error
(
"type property can't be changed"
)
;
}
}
elem
[
name
]
=
value
;
elem
[
name
]
=
value
;
...
...
src/core.js
View file @
a6ef036b
...
@@ -466,6 +466,10 @@ jQuery.extend({
...
@@ -466,6 +466,10 @@ jQuery.extend({
}
}
return
true
;
return
true
;
},
},
error
:
function
(
msg
)
{
throw
msg
;
},
noop
:
function
()
{},
noop
:
function
()
{},
...
...
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