Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/rewire.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohannes Ewald <johannes.ewald@peerigon.com>2014-05-20 14:09:13 +0400
committerJohannes Ewald <johannes.ewald@peerigon.com>2014-05-20 14:09:13 +0400
commit816cdbe0590797feec49ef4e1f696ed935b33947 (patch)
treed76fa3f632fd0be3cc1b14951c2629bd1373dfd9 /lib
parent125d7e2f4ec12eeb66c2ebc7e4e27d56cb7f1505 (diff)
Added istanbul for test coverage
Diffstat (limited to 'lib')
-rw-r--r--lib/rewire.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/rewire.js b/lib/rewire.js
index bb7c176..3daacef 100644
--- a/lib/rewire.js
+++ b/lib/rewire.js
@@ -6,6 +6,9 @@ var Module = require("module"),
detectStrictMode = require("./detectStrictMode.js"),
moduleEnv = require("./moduleEnv.js");
+var __get__Src = __get__.toString(),
+ __set__Src = __set__.toString();
+
/**
* Does actual rewiring the module. For further documentation @see index.js
*/
@@ -26,6 +29,7 @@ function internalRewire(parentModulePath, targetPath) {
// Special support for older node versions that returned an array on Module._resolveFilename
// @see https://github.com/joyent/node/blob/865b077819a9271a29f982faaef99dc635b57fbc/lib/module.js#L319
// TODO Remove this switch on the next major release
+ /* istanbul ignore next because it will be removed soon */
if (Array.isArray(targetPath)) {
targetPath = targetPath[1];
}
@@ -38,8 +42,8 @@ function internalRewire(parentModulePath, targetPath) {
// We append our special setter and getter.
appendix = "\n";
- appendix += "module.exports.__set__ = " + __set__.toString() + "; ";
- appendix += "module.exports.__get__ = " + __get__.toString() + "; ";
+ appendix += "module.exports.__set__ = " + __set__Src + "; ";
+ appendix += "module.exports.__get__ = " + __get__Src + "; ";
// Check if the module uses the strict mode.
// If so we must ensure that "use strict"; stays at the beginning of the module.