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
bd9498c5
Commit
bd9498c5
authored
Dec 17, 2012
by
Rick Waldron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.0: Remove JSON.parse shim
Signed-off-by:
Rick Waldron
<
waldron.rick@gmail.com
>
parent
25d93390
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
33 deletions
+1
-33
core.js
src/core.js
+1
-33
No files found.
src/core.js
View file @
bd9498c5
...
@@ -52,12 +52,6 @@ var
...
@@ -52,12 +52,6 @@ var
// Match a standalone tag
// Match a standalone tag
rsingleTag
=
/^<
(\w
+
)\s
*
\/?
>
(?:
<
\/\1
>|
)
$/
,
rsingleTag
=
/^<
(\w
+
)\s
*
\/?
>
(?:
<
\/\1
>|
)
$/
,
// JSON RegExp
rvalidchars
=
/^
[\]
,:{}
\s]
*$/
,
rvalidbraces
=
/
(?:
^|:|,
)(?:\s
*
\[)
+/g
,
rvalidescape
=
/
\\(?:[
"
\\\/
bfnrt
]
|u
[\d
a-fA-F
]{4})
/g
,
rvalidtokens
=
/"
[^
"
\\\r\n]
*"|true|false|null|-
?(?:\d
+
\.
|
)\d
+
(?:[
eE
][
+-
]?\d
+|
)
/g
,
// Matches dashed string for camelizing
// Matches dashed string for camelizing
rmsPrefix
=
/^-ms-/
,
rmsPrefix
=
/^-ms-/
,
rdashAlpha
=
/-
([\d
a-z
])
/gi
,
rdashAlpha
=
/-
([\d
a-z
])
/gi
,
...
@@ -495,33 +489,7 @@ jQuery.extend({
...
@@ -495,33 +489,7 @@ jQuery.extend({
},
},
parseJSON
:
function
(
data
)
{
parseJSON
:
function
(
data
)
{
// Attempt to parse using the native JSON parser first
return
window
.
JSON
.
parse
(
data
);
if
(
window
.
JSON
&&
window
.
JSON
.
parse
)
{
return
window
.
JSON
.
parse
(
data
);
}
if
(
data
===
null
)
{
return
data
;
}
if
(
typeof
data
===
"string"
)
{
// Make sure leading/trailing whitespace is removed (IE can't handle it)
data
=
jQuery
.
trim
(
data
);
if
(
data
)
{
// Make sure the incoming data is actual JSON
// Logic borrowed from http://json.org/json2.js
if
(
rvalidchars
.
test
(
data
.
replace
(
rvalidescape
,
"@"
)
.
replace
(
rvalidtokens
,
"]"
)
.
replace
(
rvalidbraces
,
""
))
)
{
return
(
new
Function
(
"return "
+
data
)
)();
}
}
}
jQuery
.
error
(
"Invalid JSON: "
+
data
);
},
},
// Cross-browser xml parsing
// Cross-browser xml parsing
...
...
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