We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74ae6f6 commit 369f2d4Copy full SHA for 369f2d4
lib/rewire.js
@@ -19,7 +19,8 @@ var srcs = {
19
function internalRewire(parentModulePath, targetPath) {
20
var targetModule,
21
prelude,
22
- appendix;
+ appendix,
23
+ src;
24
25
// Checking params
26
if (typeof targetPath !== "string") {
@@ -56,7 +57,7 @@ function internalRewire(parentModulePath, targetPath) {
56
57
58
// Check if the module uses the strict mode.
59
// If so we must ensure that "use strict"; stays at the beginning of the module.
- var src = fs.readFileSync(targetPath, "utf8");
60
+ src = fs.readFileSync(targetPath, "utf8");
61
if (detectStrictMode(src) === true) {
62
prelude = ' "use strict"; ' + prelude;
63
}
0 commit comments