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
ac93559e
Commit
ac93559e
authored
Jan 23, 2013
by
Richard Gibson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #13274: Wrap sourceMap directive in multiline comments. Close gh-1143.
parent
079ee502
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
2 deletions
+42
-2
Gruntfile.js
Gruntfile.js
+13
-2
cc_on.html
test/data/core/cc_on.html
+22
-0
core.js
test/unit/core.js
+7
-0
No files found.
Gruntfile.js
View file @
ac93559e
...
...
@@ -409,7 +409,7 @@ module.exports = function( grunt ) {
nonascii
=
false
;
distpaths
.
forEach
(
function
(
filename
)
{
var
i
,
c
,
var
i
,
c
,
map
,
text
=
fs
.
readFileSync
(
filename
,
"utf8"
);
// Ensure files use only \n for line endings, not \r\n
...
...
@@ -438,7 +438,18 @@ module.exports = function( grunt ) {
text
=
text
.
replace
(
/"dist
\/
/g
,
"
\"
"
);
fs
.
writeFileSync
(
filename
,
text
,
"utf-8"
);
}
else
if
(
/
\.
min
\.
js$/
.
test
(
filename
)
)
{
text
=
text
.
replace
(
/sourceMappingURL=dist
\/
/
,
"sourceMappingURL="
);
// Wrap sourceMap directive in multiline comments (#13274)
text
=
text
.
replace
(
/
\n?(\/\/
@
\s
*sourceMappingURL=
)(
.*
)
/
,
function
(
_
,
directive
,
path
)
{
map
=
"
\n
"
+
directive
+
path
.
replace
(
/^dist
\/
/
,
""
);
return
""
;
});
if
(
map
)
{
text
=
text
.
replace
(
/
(
^
\/\*[\w\W]
*
?)\s
*
\*\/
|$/
,
function
(
_
,
comment
)
{
return
(
comment
||
"
\n
/*"
)
+
map
+
"
\n
*/"
;
});
}
fs
.
writeFileSync
(
filename
,
text
,
"utf-8"
);
}
...
...
test/data/core/cc_on.html
0 → 100644
View file @
ac93559e
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
<script>
var
cc_on
=
false
,
errors
=
[];
/*@cc_on
cc_on = true;
@*/
window
.
onerror
=
function
(
errorMessage
,
filePath
,
lineNumber
)
{
errors
.
push
(
errorMessage
);
};
</script>
<script
src=
"../../../dist/jquery.min.js"
></script>
</head>
<body>
<script>
window
.
parent
.
iframeCallback
(
cc_on
,
errors
,
jQuery
);
</script>
</body>
</html>
test/unit/core.js
View file @
ac93559e
...
...
@@ -17,6 +17,13 @@ test("Basic requirements", function() {
ok
(
$
,
"$"
);
});
testIframeWithCallback
(
"Conditional compilation compatibility (#13274)"
,
"core/cc_on.html"
,
function
(
cc_on
,
errors
,
$
)
{
expect
(
3
);
ok
(
true
,
"JScript conditional compilation "
+
(
cc_on
?
"supported"
:
"not supported"
)
);
deepEqual
(
errors
,
[],
"No errors"
);
ok
(
$
(),
"jQuery executes"
);
});
test
(
"jQuery()"
,
function
()
{
var
elem
,
i
,
...
...
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