From 097b4162dab6e0be89bd92a152cd8946685baf36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 17 Jul 2013 16:23:17 -0700 Subject: [PATCH] Pass on 'this' as root scope, for better inclusion of Acorn inside Paper.js Use same approach as Esprima. --- acorn.js | 6 +++--- acorn_loose.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/acorn.js b/acorn.js index 43db6e9e03..9808f43da6 100644 --- a/acorn.js +++ b/acorn.js @@ -20,11 +20,11 @@ // [dammit]: acorn_loose.js // [walk]: util/walk.js -(function(mod) { +(function(root, mod) { if (typeof exports == "object" && typeof module == "object") return mod(exports); // CommonJS if (typeof define == "function" && define.amd) return define(["exports"], mod); // AMD - mod(this.acorn || (this.acorn = {})); // Plain browser env -})(function(exports) { + mod(root.acorn || (root.acorn = {})); // Plain browser env +})(this, function(exports) { "use strict"; exports.version = "0.3.2"; diff --git a/acorn_loose.js b/acorn_loose.js index 105fe7ddc2..cf73345e28 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -29,11 +29,11 @@ // invasive changes and simplifications without creating a complicated // tangle. -(function(mod) { +(function(root, 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(this.acorn || (this.acorn = {}), this.acorn); // Plain browser env -})(function(exports, acorn) { + mod(root.acorn || (root.acorn = {}), root.acorn); // Plain browser env +})(this, function(exports, acorn) { "use strict"; var tt = acorn.tokTypes;