From 4d8eeabf52d5db4ff3ad552848d82a8c6df2fbd8 Mon Sep 17 00:00:00 2001
From: Marijn Haverbeke
Date: Wed, 8 May 2013 15:16:06 +0200
Subject: [PATCH] In browser loader, refer to global object as 'this', not
'self'
Closes #41
---
acorn.js | 2 +-
acorn_loose.js | 2 +-
index.html | 2 +-
util/walk.js | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
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";
|