Permalink
Browse files

Fix caching lookup

  • Loading branch information...
1 parent e9b59c0 commit 377ade364918e66ff5b3d74bd4650d89360df2c0 @josh josh committed Dec 12, 2010
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/stitch.js
  2. +1 −1 src/stitch.coffee
View
@@ -135,9 +135,9 @@
});
};
Package.prototype.compileFile = function(path, callback) {
- var compile, err, extension, mod, mtime, source, _ref;
+ var compile, err, extension, mod, mtime, source;
extension = extname(path).slice(1);
- if (this.cache && this.mtimeCache[path] === ((_ref = this.compileCache[path]) != null ? _ref.mtime : void 0)) {
+ if (this.cache && this.compileCache[path] && this.mtimeCache[path] === this.compileCache[path].mtime) {
return callback(null, this.compileCache[path].source);
} else if (compile = this.compilers[extension]) {
source = null;
View
@@ -124,7 +124,7 @@ exports.Package = class Package
compileFile: (path, callback) ->
extension = extname(path).slice(1)
- if @cache and @mtimeCache[path] is @compileCache[path]?.mtime
+ if @cache and @compileCache[path] and @mtimeCache[path] is @compileCache[path].mtime
callback null, @compileCache[path].source
else if compile = @compilers[extension]
source = null

0 comments on commit 377ade3

Please sign in to comment.