Skip to content

Commit

Permalink
Enter async mode only when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
jscheid committed Jun 14, 2015
1 parent 2355226 commit c02e983
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ var transpile = function(source, options) {
};

module.exports = function(source, inputSourceMap) {
var callback = this.async();
var result = {};
// Handle options
var defaultOptions = {
Expand Down Expand Up @@ -50,6 +49,7 @@ module.exports = function(source, inputSourceMap) {
this.cacheable();

if (cacheDirectory) {
var callback = this.async();
return cache({
directory: cacheDirectory,
identifier: cacheIdentifier,
Expand All @@ -63,6 +63,6 @@ module.exports = function(source, inputSourceMap) {
}

result = transpile(source, options);
return callback(null, result.code, result.map);
this.callback(null, result.code, result.map);

};

0 comments on commit c02e983

Please sign in to comment.