mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Use # instead of @ for sourceURLs and sourceMappingURLs.
Former-commit-id: ba78f92591c0cf28dba4c7a93a49f6e0f7ebb305
This commit is contained in:
@@ -445,7 +445,7 @@
|
|||||||
if (isMapped) {
|
if (isMapped) {
|
||||||
var mapOutput = fs.readFileSync(mapPath, 'utf8');
|
var mapOutput = fs.readFileSync(mapPath, 'utf8');
|
||||||
fs.unlinkSync(mapPath);
|
fs.unlinkSync(mapPath);
|
||||||
output = output.replace(/[\s;]*$/, '\n/*\n//@ sourceMappingURL=' + sourceMapURL) + '\n*/';
|
output = output.replace(/[\s;]*$/, '\n//# sourceMappingURL=' + sourceMapURL);
|
||||||
|
|
||||||
mapOutput = JSON.parse(mapOutput);
|
mapOutput = JSON.parse(mapOutput);
|
||||||
mapOutput.file = path.basename(outputPath);
|
mapOutput.file = path.basename(outputPath);
|
||||||
|
|||||||
@@ -5521,7 +5521,7 @@
|
|||||||
// avoid issues with Narwhal, IE conditional compilation, and the JS engine
|
// avoid issues with Narwhal, IE conditional compilation, and the JS engine
|
||||||
// embedded in Adobe products.
|
// embedded in Adobe products.
|
||||||
// http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
|
// http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
|
||||||
var sourceURL = '\n/*\n//@ sourceURL=' + (options.sourceURL || '/lodash/template/source[' + (templateCounter++) + ']') + '\n*/';
|
var sourceURL = '\n/*\n//# sourceURL=' + (options.sourceURL || '/lodash/template/source[' + (templateCounter++) + ']') + '\n*/';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var result = Function(importsKeys, 'return ' + source + sourceURL).apply(undefined, importsValues);
|
var result = Function(importsKeys, 'return ' + source + sourceURL).apply(undefined, importsValues);
|
||||||
|
|||||||
@@ -819,12 +819,11 @@
|
|||||||
asyncTest('`lodash ' + mapCommand + (outputCommand ? ' ' + outputCommand : '') + '`', function() {
|
asyncTest('`lodash ' + mapCommand + (outputCommand ? ' ' + outputCommand : '') + '`', function() {
|
||||||
var callback = _.once(function(data) {
|
var callback = _.once(function(data) {
|
||||||
var basename = path.basename(data.outputPath, '.js'),
|
var basename = path.basename(data.outputPath, '.js'),
|
||||||
comment = (/(\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)$/.exec(data.source) || [])[0],
|
|
||||||
sources = /foo.js/.test(outputCommand) ? ['foo.js'] : ['lodash' + (outputCommand.length ? '' : '.custom') + '.js'],
|
sources = /foo.js/.test(outputCommand) ? ['foo.js'] : ['lodash' + (outputCommand.length ? '' : '.custom') + '.js'],
|
||||||
sourceMap = JSON.parse(data.sourceMap),
|
sourceMap = JSON.parse(data.sourceMap),
|
||||||
sourceMapURL = (/\w+(?=\.map$)/.exec(mapCommand) || [basename])[0];
|
sourceMapURL = (/\w+(?=\.map$)/.exec(mapCommand) || [basename])[0];
|
||||||
|
|
||||||
ok(RegExp('/\\*\\n//@ sourceMappingURL=' + sourceMapURL + '.map\\n\\*/').test(comment), basename);
|
ok(RegExp('\\n//# sourceMappingURL=' + sourceMapURL + '.map$').test(data.source), basename);
|
||||||
equal(sourceMap.file, basename + '.js', basename);
|
equal(sourceMap.file, basename + '.js', basename);
|
||||||
deepEqual(sourceMap.sources, sources, basename);
|
deepEqual(sourceMap.sources, sources, basename);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user