Skip to content

Commit

Permalink
Merge pull request #175 from brandonmcquarie/patch-1
Browse files Browse the repository at this point in the history
Additional Fix For Error: TypeError: path must be a string
  • Loading branch information
SlexAxton committed Apr 14, 2014
2 parents 6fa1ef8 + b7ee39c commit 8943181
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hbs.js
Expand Up @@ -106,7 +106,7 @@ define([
var xdr = getXhr(true);
xdr.open('GET', url);
xdr.onload = function() {
callback(xdr.responseText);
callback(xdr.responseText, url);
};
xdr.onprogress = function(){};
xdr.ontimeout = function(){};
Expand All @@ -122,7 +122,7 @@ define([
//Do not explicitly handle errors, those should be
//visible via console output in the browser.
if (xhr.readyState === 4) {
callback(xhr.responseText);
callback(xhr.responseText, url);
}
};
xhr.send(null);
Expand All @@ -141,7 +141,7 @@ define([
var body = fs.readFileSync(path, 'utf8') || '';
// we need to remove BOM stuff from the file content
body = body.replace(/^\uFEFF/, '');
callback(body);
callback(body, path);
};
}
else if (typeof java !== 'undefined' && typeof java.io !== 'undefined') {
Expand All @@ -155,7 +155,7 @@ define([
text += new String(line) + '\n';
}
reader.close();
callback(text);
callback(text, path);
};
}

Expand All @@ -165,7 +165,7 @@ define([
callback(cache[path]);
}
else {
fetchText(path, function(data){
fetchText(path, function(data, path){
cache[path] = data;
callback.call(this, data);
});
Expand Down Expand Up @@ -385,7 +385,7 @@ define([
};

function fetchAndRegister(langMap) {
fetchText(path, function(text) {
fetchText(path, function(text, path) {
// for some reason it doesn't include hbs _first_ when i don't add it here...
var nodes = Handlebars.parse(text);
var partials = findPartialDeps( nodes );
Expand Down Expand Up @@ -576,7 +576,7 @@ define([
});
}

if ( config.removeCombined ) {
if ( config.removeCombined && path ) {
fs.unlinkSync(path);
}

Expand Down

1 comment on commit 8943181

@MaffooBristol
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do a new tag/update bower for this please? It's a roadblock in my app and I have to keep manually changing the file!

Please sign in to comment.