Skip to content

Commit

Permalink
Merge branch '1.X'
Browse files Browse the repository at this point in the history
  • Loading branch information
nmccready committed Oct 13, 2016
2 parents 7637ec5 + 39e1b3b commit eb5d25d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ language: node_js
node_js:
- 6
- 4
- 0.12

cache:
directories:
Expand Down
14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports.init = function init(options) {
if (options === undefined) {
options = {};
}
debug(() => {return options;});
debug(function () {return options;});

var fileContent = file.contents.toString();
var sourceMap;
Expand Down Expand Up @@ -120,7 +120,7 @@ module.exports.init = function init(options) {
}

if (!sourceMap && options.identityMap) {
debug(() => { return 'identityMap'; });
debug(function () { return 'identityMap'; });
var fileType = path.extname(file.path);
var source = unixStylePath(file.relative);
var generator = new SourceMapGenerator({file: source});
Expand All @@ -147,7 +147,7 @@ module.exports.init = function init(options) {
} else if (fileType === '.css') {
debug('css');
var ast = css.parse(fileContent, {silent: true});
debug(() => { return ast;});
debug(function () { return ast;});
var registerTokens = function(ast) {
if (ast.position) {
generator.addMapping({
Expand All @@ -158,8 +158,8 @@ module.exports.init = function init(options) {
}

function logAst(key, ast) {
debug(() => { return 'key: ' + key;});
debug(() => { return ast[key];});
debug(function () { return 'key: ' + key;});
debug(function () { return ast[key];});
}

for (var key in ast) {
Expand All @@ -168,7 +168,7 @@ module.exports.init = function init(options) {
if (Object.prototype.toString.call(ast[key]) === '[object Object]') {
registerTokens(ast[key]);
} else if (Array.isArray(ast[key])) {
debug(() => { return "@@@@ ast[key] isArray @@@@";});
debug(function () { return "@@@@ ast[key] isArray @@@@";});
for (var i = 0; i < ast[key].length; i++) {
registerTokens(ast[key][i]);
}
Expand Down Expand Up @@ -226,7 +226,7 @@ module.exports.write = function write(destPath, options) {
if (options.charset === undefined)
options.charset = "utf8";

debug(()=> {return options;});
debug(function() {return options;});
function sourceMapWrite(file, encoding, callback) {
/*jshint validthis:true */

Expand Down
2 changes: 1 addition & 1 deletion test/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ test('init: should output an error message if debug option is set and sourceCont

var history = [];
console.log('HOOKING');
var unhook = hookStd.stderr((s) => history.push(s));
var unhook = hookStd.stderr(function (s) {history.push(s);});
var pipeline = sourcemaps.init({loadMaps: true, debug: true});

pipeline
Expand Down
2 changes: 1 addition & 1 deletion test/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ test('write: should output an error message if debug option is set and sourceCon
delete file.sourceMap.sourcesContent;

var history = [];
var unhook = hookStd.stderr(s => history.push(s));
var unhook = hookStd.stderr(function(s) {history.push(s);});
var pipeline = sourcemaps.write({debug: true});
pipeline
.on('data', function(data) {
Expand Down

0 comments on commit eb5d25d

Please sign in to comment.