1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
From 281c92340088a1455493c7a82d47066c7153d041 Mon Sep 17 00:00:00 2001
From: Julien Puydt <julien.puydt@laposte.net>
Date: Mon, 19 Oct 2015 22:25:23 +0200
Subject: Workaround for upstream issue 199
---
lib/module.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/module.js b/lib/module.js
index 96529c5..a659641 100644
--- a/lib/module.js
+++ b/lib/module.js
@@ -136,7 +136,11 @@ memo(Module.prototype, 'ast', /** @this Module */function() {
* @name Module#src
*/
memo(Module.prototype, 'src', /** @this Module */function() {
- return fs.readFileSync(this.path).toString();
+ if (endsWith(this.path, '.js')) {
+ return fs.readFileSync(this.path).toString();
+ } else {
+ return fs.readFileSync(this.path+'.js').toString();
+ };
});
/**
|