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
b760d798
Commit
b760d798
authored
Jan 05, 2013
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #12471. Use consistent line endings in jquery.js
parent
c0241a47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
Gruntfile.js
Gruntfile.js
+14
-5
No files found.
Gruntfile.js
View file @
b760d798
...
...
@@ -189,8 +189,8 @@ module.exports = function( grunt ) {
grunt
.
verbose
.
write
(
"Injected sizzle-jquery.js into sizzle.js"
);
// Write concatenated source to file
grunt
.
file
.
write
(
name
,
compiled
);
// Write concatenated source to file
, and ensure newline-only termination
grunt
.
file
.
write
(
name
,
compiled
.
replace
(
/
\x
0d
\x
0a/g
,
"
\
x0a"
)
);
// Fail task if errors were logged.
if
(
this
.
errorCount
)
{
...
...
@@ -409,8 +409,17 @@ module.exports = function( grunt ) {
nonascii
=
false
;
distpaths
.
forEach
(
function
(
filename
)
{
var
text
=
fs
.
readFileSync
(
filename
,
"utf8"
),
i
,
c
;
var
i
,
c
,
text
=
fs
.
readFileSync
(
filename
,
"utf8"
);
// Ensure files use only \n for line endings, not \r\n
if
(
/
\x
0d
\x
0a/
.
test
(
text
)
)
{
grunt
.
log
.
writeln
(
filename
+
": Incorrect line endings (
\\
r
\
\n
)"
);
nonascii
=
true
;
return
;
}
// Ensure only ASCII chars so script tags don't need a charset attribute
if
(
text
.
length
!==
Buffer
.
byteLength
(
text
,
"utf8"
)
)
{
grunt
.
log
.
writeln
(
filename
+
": Non-ASCII characters detected:"
);
for
(
i
=
0
;
i
<
text
.
length
;
i
++
)
{
...
...
@@ -418,10 +427,10 @@ module.exports = function( grunt ) {
if
(
c
>
127
)
{
grunt
.
log
.
writeln
(
"- position "
+
i
+
": "
+
c
);
grunt
.
log
.
writeln
(
"-- "
+
text
.
substring
(
i
-
20
,
i
+
20
)
);
nonascii
=
true
;
break
;
}
}
nonascii
=
true
;
}
// Modify map so that it points to files in the same folder;
...
...
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