From f58bb9a4808873efac685e7c0d011d6d48a97d14 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Thu, 29 Nov 2012 10:08:32 +0100 Subject: [PATCH] Use 'self' instead of 'window' in browser, in order to work in a web worker --- acorn.js | 4 ++-- index.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/acorn.js b/acorn.js index 80f0d99f96..64abf4bc40 100644 --- a/acorn.js +++ b/acorn.js @@ -18,7 +18,7 @@ exports.version = "0.0.1"; - // The main exported interface (under `window.acorn` when in the + // The main exported interface (under `self.acorn` when in the // browser) is a `parse` function that takes a code string and // returns an abstract syntax tree as specified by [Mozilla parser // API][api], with the caveat that the SpiderMonkey-specific syntax @@ -1653,4 +1653,4 @@ return finishNode(node, "Identifier"); } -})(typeof exports === "undefined" ? (window.acorn = {}) : exports); +})(typeof exports === "undefined" ? (self.acorn = {}) : exports); diff --git a/index.html b/index.html index dbf10f30c1..b844133476 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ https://github.com/marijnh/acorn.git

Please use the github bug tracker to report issues.

(function(exports) {
   "use strict";
 
-  exports.version = "0.0.1";

The main exported interface (under window.acorn when in the + exports.version = "0.0.1";

The main exported interface (under self.acorn when in the browser) is a parse function that takes a code string and returns an abstract syntax tree as specified by Mozilla parser API, with the caveat that the SpiderMonkey-specific syntax @@ -1236,6 +1236,6 @@ identifiers.

< return finishNode(node, "Identifier"); } -})(typeof exports === "undefined" ? (window.acorn = {}) : exports); +})(typeof exports === "undefined" ? (self.acorn = {}) : exports); \ No newline at end of file