diff --git a/acorn.js b/acorn.js index e62febdf73..8a7f25cefc 100644 --- a/acorn.js +++ b/acorn.js @@ -23,7 +23,7 @@ (function(mod) { if (typeof exports == "object" && typeof module == "object") return mod(exports); // CommonJS if (typeof define == "function" && define.amd) return define(["exports"], mod); // AMD - mod(self.acorn || (self.acorn = {})); // Plain browser env + mod(this.acorn || (this.acorn = {})); // Plain browser env })(function(exports) { "use strict"; diff --git a/acorn_loose.js b/acorn_loose.js index 8c781a337d..9341a20ec6 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -32,7 +32,7 @@ (function(mod) { if (typeof exports == "object" && typeof module == "object") return mod(exports, require("./acorn")); // CommonJS if (typeof define == "function" && define.amd) return define(["exports", "./acorn"], mod); // AMD - mod(self.acorn || (self.acorn = {}), self.acorn); // Plain browser env + mod(this.acorn || (this.acorn = {}), this.acorn); // Plain browser env })(function(exports, acorn) { "use strict"; diff --git a/index.html b/index.html index 93f868240e..64b2526591 100644 --- a/index.html +++ b/index.html @@ -17,7 +17,7 @@ with a error-tolerant parser and an abstract syntax tree walker, defined in other files.

(function(mod) {
   if (typeof exports == "object" && typeof module == "object") return mod(exports); // CommonJS
   if (typeof define == "function" && define.amd) return define(["exports"], mod); // AMD
-  mod(self.acorn || (self.acorn = {})); // Plain browser env
+  mod(this.acorn || (this.acorn = {})); // Plain browser env
 })(function(exports) {
   "use strict";
 
diff --git a/util/walk.js b/util/walk.js
index ea7eea19ec..e1e02f27a1 100644
--- a/util/walk.js
+++ b/util/walk.js
@@ -3,7 +3,7 @@
 (function(mod) {
   if (typeof exports == "object" && typeof module == "object") return mod(exports); // CommonJS
   if (typeof define == "function" && define.amd) return define(["exports"], mod); // AMD
-  mod(self.acorn.walk = {}); // Plain browser env
+  mod((this.acorn || (this.acorn = {})).walk = {}); // Plain browser env
 })(function(exports) {
   "use strict";