From c8ef39e0b54a9246ec165f9c90dbdc3ba5e733d0 Mon Sep 17 00:00:00 2001 From: silentcloud Date: Fri, 24 Jun 2016 17:48:55 +0800 Subject: [PATCH 1/2] fix custom comiler file (absolute path) support in windows system --- bin/_mocha | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/_mocha b/bin/_mocha index ad4ed40373..d0857ac5e1 100755 --- a/bin/_mocha +++ b/bin/_mocha @@ -295,9 +295,9 @@ if (program.retries) mocha.suite.retries(program.retries); var extensions = ['js']; program.compilers.forEach(function(c) { - var compiler = c.split(':') - , ext = compiler[0] - , mod = compiler[1]; + var compiler = c.match(/([a-z.]+):(([A-Z]:)?\S*)+/) + , ext = compiler[1] + , mod = compiler[2]; if (mod[0] == '.') mod = join(process.cwd(), mod); require(mod); From 92bf5279c128c39f1f65d45f9339d65859c35591 Mon Sep 17 00:00:00 2001 From: silentcloud Date: Tue, 28 Jun 2016 09:44:09 +0800 Subject: [PATCH 2/2] replace regular expression with slice --- bin/_mocha | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/_mocha b/bin/_mocha index d0857ac5e1..559e91fdfb 100755 --- a/bin/_mocha +++ b/bin/_mocha @@ -295,9 +295,9 @@ if (program.retries) mocha.suite.retries(program.retries); var extensions = ['js']; program.compilers.forEach(function(c) { - var compiler = c.match(/([a-z.]+):(([A-Z]:)?\S*)+/) - , ext = compiler[1] - , mod = compiler[2]; + var idx = c.indexOf(':') + , ext = c.slice(0, idx) + , mod = c.slice(idx + 1); if (mod[0] == '.') mod = join(process.cwd(), mod); require(mod);