From 6a7a3ea3ab206074cf9390cf2fede6594c780840 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Sun, 19 Feb 2012 18:31:46 -0800 Subject: [PATCH] Provide a better last modified date for require-kernel. --- node/utils/Minify.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/node/utils/Minify.js b/node/utils/Minify.js index d37ec3cd..d09ba828 100644 --- a/node/utils/Minify.js +++ b/node/utils/Minify.js @@ -166,6 +166,8 @@ function statFile(filename, callback) { lastModifiedDateOfEverything(function (error, date) { callback(error, date, !error); }); + } else if (filename == 'js/require-kernel.js') { + callback(null, requireLastModified(), true); } else { fs.stat(ROOT_DIR + filename, function (error, stats) { if (error) { @@ -177,8 +179,6 @@ function statFile(filename, callback) { } else { callback(error); } - } else if (filename == 'js/require-kernel.js') { - callback(null, stats.mtime.getTime(), true); } else { callback(null, stats.mtime.getTime(), false); } @@ -232,6 +232,12 @@ function lastModifiedDateOfEverything(callback) { }); } +// This should be provided by the module, but until then, just use startup +// time. +var _requireLastModified = new Date(); +function requireLastModified() { + return _requireLastModified.toUTCString(); +} function requireDefinition() { return 'var require = ' + RequireKernel.kernelSource + ';\n'; }