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
14503054
Commit
14503054
authored
Oct 11, 2012
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the correct escape for BOM; add build code to detect non-ASCII.
parent
798a7a7e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
grunt.js
grunt.js
+21
-0
core.js
src/core.js
+1
-1
No files found.
grunt.js
View file @
14503054
...
@@ -416,6 +416,27 @@ module.exports = function( grunt ) {
...
@@ -416,6 +416,27 @@ module.exports = function( grunt ) {
return
path
!==
"*"
;
return
path
!==
"*"
;
});
});
// Ensure the dist files are pure ASCII
var
fs
=
require
(
"fs"
),
nonascii
=
false
;
distpaths
.
forEach
(
function
(
filename
)
{
var
buf
=
fs
.
readFileSync
(
filename
,
"utf8"
),
i
,
c
;
if
(
buf
.
length
!==
Buffer
.
byteLength
(
buf
,
"utf8"
)
)
{
log
.
writeln
(
filename
+
": Non-ASCII characters detected:"
);
for
(
i
=
0
;
i
<
buf
.
length
;
i
++
)
{
c
=
buf
.
charCodeAt
(
i
);
if
(
c
>
127
)
{
log
.
writeln
(
"- position "
+
i
+
": "
+
c
);
log
.
writeln
(
"-- "
+
buf
.
substring
(
i
-
20
,
i
+
20
)
);
nonascii
=
true
;
}
}
}
});
if
(
nonascii
)
{
return
false
;
}
// Proceed only if there are actual
// Proceed only if there are actual
// paths to write to
// paths to write to
...
...
src/core.js
View file @
14503054
...
@@ -605,7 +605,7 @@ jQuery.extend({
...
@@ -605,7 +605,7 @@ jQuery.extend({
},
},
// Use native String.trim function wherever possible
// Use native String.trim function wherever possible
trim
:
core_trim
&&
!
core_trim
.
call
(
"
\
x
FEFF
\
xA0"
)
?
trim
:
core_trim
&&
!
core_trim
.
call
(
"
\
u
FEFF
\
xA0"
)
?
function
(
text
)
{
function
(
text
)
{
return
text
==
null
?
return
text
==
null
?
""
:
""
:
...
...
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