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