From de91678d27c69e6dbb7b0ae6136985254d9fea79 Mon Sep 17 00:00:00 2001 From: Yuqian Ma Date: Wed, 2 Jun 2021 16:15:14 +0800 Subject: [PATCH] fix: keep modname starts with `./` (#485) * fix: keep modname starts with `./` Signed-off-by: Yuqian Ma * style: use doublequote Signed-off-by: Yuqian Ma * bump up version: 2.3.17 Signed-off-by: Yuqian Ma --- js.json | 4 ++-- package-lock.json | 2 +- package.json | 2 +- src/req-manager.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js.json b/js.json index aa14d28a..fdd6d08c 100644 --- a/js.json +++ b/js.json @@ -51,7 +51,7 @@ "--init" ] }, - "version": "2.3.16", + "version": "2.3.17", "gaugeVersionSupport": { "minimum": "1.0.7", "maximum": "" @@ -62,4 +62,4 @@ "linux": [] }, "id": "js" -} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0a15e25e..100e28f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gauge-js", - "version": "2.3.16", + "version": "2.3.17", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5373e53a..48253652 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gauge-js", - "version": "2.3.16", + "version": "2.3.17", "description": "JavaScript runner for Gauge", "main": "index.js", "scripts": { diff --git a/src/req-manager.js b/src/req-manager.js index 2a94cf03..97fbe67f 100644 --- a/src/req-manager.js +++ b/src/req-manager.js @@ -23,7 +23,7 @@ Req.prototype.load = function (modname) { } return (function (self, mod, modname) { - if (self.nativeModules.indexOf(modname) < 0) { + if (!modname.startsWith("./") && self.nativeModules.indexOf(modname) < 0) { modname = path.normalize(modname); } var m = new mod.Module(self.filepath, mod.Module);