@@ -36,19 +36,14 @@ function internalRewire(parentModulePath, targetPath) {
36
36
// We prepend a list of all globals declared with var so they can be overridden (without changing original globals)
37
37
prelude = getImportGlobalsSrc ( ) ;
38
38
39
- // The module src is wrapped inside a self-executing function.
40
- // This is necessary to separate the module src from the preceding importGlobalsSrc,
41
- // because the module src can be in strict mode.
42
- // In strict mode eval() can only declare vars in the current scope. In this case our setters
43
- // and getters won't work.
44
- //@see http://whereswalden.com/2011/01/10/new-es5-strict-mode-support-new-vars-created-by-strict-mode-eval-code-are-local-to-that-code-only/
45
- // It also circumvents a problem with identical global variables and function declarations
39
+ // Wrap module src inside IIFE so that function declarations do not clash with global variables
46
40
//@see https://github.com/jhnns/rewire/issues/56
47
41
prelude += "(function () { " ;
48
42
49
43
// We append our special setter and getter.
50
44
appendix = "\n" + getDefinePropertySrc ( ) ;
51
- // End of self-executing function
45
+
46
+ // End of IIFE
52
47
appendix += "})();" ;
53
48
54
49
// Check if the module uses the strict mode.